Unable to find design file in Vaadin










0















I wanna make a navigation between views in vaadin.
I made 2 views with html and navigator but when I initialize the first view I have a DesignException



com.vaadin.ui.declarative.DesignException: Unable to find design file MainView.html in com.andrei
at com.vaadin.ui.declarative.Design.read(Design.java:608)
at com.andrei.MainView.<init>(MainView.java:23)
at com.andrei.MyUI.init(MyUI.java:39)
at com.vaadin.ui.UI.doInit(UI.java:770)
at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:218)
at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:76)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1601)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:445)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)


Im tried to put html file in com.andrei directory but it not works , after that
I found infomation that html file must be in resource folder , but it dont work, again,where I must put this file , or how can I change rootPath to directory



enter image description here



This is my UI



@Theme("mytheme")
public class MyUI extends UI
Navigator navigator;
protected static final String MAINVIEW = "main";

@Override
protected void init(VaadinRequest vaadinRequest)
navigator = new Navigator(this, this);

// Create and register the views
navigator.addView("", new StartView());
navigator.addView(MAINVIEW, new MainView(navigator));





@WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
public static class MyUIServlet extends VaadinServlet





This is MainView:



MainView



@DesignRoot
public class MainView extends VerticalLayout implements View
// Menu navigation button listener


VerticalLayout menuContent;
Panel equalPanel;
Button logout;

public MainView(Navigator navigator)
Design.read(this);

logout.addClickListener(event ->
navigator.navigateTo(""));


@DesignRoot
class AnimalViewer extends VerticalLayout
Label watching;
Embedded pic;
Label back;

public AnimalViewer(String animal)
Design.read(this);

watching.setValue("You are currently watching a " +
animal);
pic.setSource(new ThemeResource(
"img/" + animal + "-128px.png"));
back.setValue("and " + animal +
" is watching you back");



@Override
public void enter(ViewChangeListener.ViewChangeEvent event)










share|improve this question






















  • find design file MainView.html in com.andrei. Put the MainView.html in com/andrei within your classpath (e.g. inside your resources dir)

    – cfrick
    Nov 14 '18 at 15:11











  • Im sorry but i do not understand, can you explain , I must put MainView.html in com/andrei , i put it , but nothing changed

    – Andrei Gospodarenco
    Nov 14 '18 at 15:18















0















I wanna make a navigation between views in vaadin.
I made 2 views with html and navigator but when I initialize the first view I have a DesignException



com.vaadin.ui.declarative.DesignException: Unable to find design file MainView.html in com.andrei
at com.vaadin.ui.declarative.Design.read(Design.java:608)
at com.andrei.MainView.<init>(MainView.java:23)
at com.andrei.MyUI.init(MyUI.java:39)
at com.vaadin.ui.UI.doInit(UI.java:770)
at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:218)
at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:76)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1601)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:445)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)


Im tried to put html file in com.andrei directory but it not works , after that
I found infomation that html file must be in resource folder , but it dont work, again,where I must put this file , or how can I change rootPath to directory



enter image description here



This is my UI



@Theme("mytheme")
public class MyUI extends UI
Navigator navigator;
protected static final String MAINVIEW = "main";

@Override
protected void init(VaadinRequest vaadinRequest)
navigator = new Navigator(this, this);

// Create and register the views
navigator.addView("", new StartView());
navigator.addView(MAINVIEW, new MainView(navigator));





@WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
public static class MyUIServlet extends VaadinServlet





This is MainView:



MainView



@DesignRoot
public class MainView extends VerticalLayout implements View
// Menu navigation button listener


VerticalLayout menuContent;
Panel equalPanel;
Button logout;

public MainView(Navigator navigator)
Design.read(this);

logout.addClickListener(event ->
navigator.navigateTo(""));


@DesignRoot
class AnimalViewer extends VerticalLayout
Label watching;
Embedded pic;
Label back;

public AnimalViewer(String animal)
Design.read(this);

watching.setValue("You are currently watching a " +
animal);
pic.setSource(new ThemeResource(
"img/" + animal + "-128px.png"));
back.setValue("and " + animal +
" is watching you back");



@Override
public void enter(ViewChangeListener.ViewChangeEvent event)










share|improve this question






















  • find design file MainView.html in com.andrei. Put the MainView.html in com/andrei within your classpath (e.g. inside your resources dir)

    – cfrick
    Nov 14 '18 at 15:11











  • Im sorry but i do not understand, can you explain , I must put MainView.html in com/andrei , i put it , but nothing changed

    – Andrei Gospodarenco
    Nov 14 '18 at 15:18













0












0








0


0






I wanna make a navigation between views in vaadin.
I made 2 views with html and navigator but when I initialize the first view I have a DesignException



com.vaadin.ui.declarative.DesignException: Unable to find design file MainView.html in com.andrei
at com.vaadin.ui.declarative.Design.read(Design.java:608)
at com.andrei.MainView.<init>(MainView.java:23)
at com.andrei.MyUI.init(MyUI.java:39)
at com.vaadin.ui.UI.doInit(UI.java:770)
at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:218)
at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:76)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1601)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:445)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)


Im tried to put html file in com.andrei directory but it not works , after that
I found infomation that html file must be in resource folder , but it dont work, again,where I must put this file , or how can I change rootPath to directory



enter image description here



This is my UI



@Theme("mytheme")
public class MyUI extends UI
Navigator navigator;
protected static final String MAINVIEW = "main";

@Override
protected void init(VaadinRequest vaadinRequest)
navigator = new Navigator(this, this);

// Create and register the views
navigator.addView("", new StartView());
navigator.addView(MAINVIEW, new MainView(navigator));





@WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
public static class MyUIServlet extends VaadinServlet





This is MainView:



MainView



@DesignRoot
public class MainView extends VerticalLayout implements View
// Menu navigation button listener


VerticalLayout menuContent;
Panel equalPanel;
Button logout;

public MainView(Navigator navigator)
Design.read(this);

logout.addClickListener(event ->
navigator.navigateTo(""));


@DesignRoot
class AnimalViewer extends VerticalLayout
Label watching;
Embedded pic;
Label back;

public AnimalViewer(String animal)
Design.read(this);

watching.setValue("You are currently watching a " +
animal);
pic.setSource(new ThemeResource(
"img/" + animal + "-128px.png"));
back.setValue("and " + animal +
" is watching you back");



@Override
public void enter(ViewChangeListener.ViewChangeEvent event)










share|improve this question














I wanna make a navigation between views in vaadin.
I made 2 views with html and navigator but when I initialize the first view I have a DesignException



com.vaadin.ui.declarative.DesignException: Unable to find design file MainView.html in com.andrei
at com.vaadin.ui.declarative.Design.read(Design.java:608)
at com.andrei.MainView.<init>(MainView.java:23)
at com.andrei.MyUI.init(MyUI.java:39)
at com.vaadin.ui.UI.doInit(UI.java:770)
at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:218)
at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:76)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1601)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:445)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)


Im tried to put html file in com.andrei directory but it not works , after that
I found infomation that html file must be in resource folder , but it dont work, again,where I must put this file , or how can I change rootPath to directory



enter image description here



This is my UI



@Theme("mytheme")
public class MyUI extends UI
Navigator navigator;
protected static final String MAINVIEW = "main";

@Override
protected void init(VaadinRequest vaadinRequest)
navigator = new Navigator(this, this);

// Create and register the views
navigator.addView("", new StartView());
navigator.addView(MAINVIEW, new MainView(navigator));





@WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
public static class MyUIServlet extends VaadinServlet





This is MainView:



MainView



@DesignRoot
public class MainView extends VerticalLayout implements View
// Menu navigation button listener


VerticalLayout menuContent;
Panel equalPanel;
Button logout;

public MainView(Navigator navigator)
Design.read(this);

logout.addClickListener(event ->
navigator.navigateTo(""));


@DesignRoot
class AnimalViewer extends VerticalLayout
Label watching;
Embedded pic;
Label back;

public AnimalViewer(String animal)
Design.read(this);

watching.setValue("You are currently watching a " +
animal);
pic.setSource(new ThemeResource(
"img/" + animal + "-128px.png"));
back.setValue("and " + animal +
" is watching you back");



@Override
public void enter(ViewChangeListener.ViewChangeEvent event)







java vaadin






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 14 '18 at 15:08









Andrei GospodarencoAndrei Gospodarenco

8919




8919












  • find design file MainView.html in com.andrei. Put the MainView.html in com/andrei within your classpath (e.g. inside your resources dir)

    – cfrick
    Nov 14 '18 at 15:11











  • Im sorry but i do not understand, can you explain , I must put MainView.html in com/andrei , i put it , but nothing changed

    – Andrei Gospodarenco
    Nov 14 '18 at 15:18

















  • find design file MainView.html in com.andrei. Put the MainView.html in com/andrei within your classpath (e.g. inside your resources dir)

    – cfrick
    Nov 14 '18 at 15:11











  • Im sorry but i do not understand, can you explain , I must put MainView.html in com/andrei , i put it , but nothing changed

    – Andrei Gospodarenco
    Nov 14 '18 at 15:18
















find design file MainView.html in com.andrei. Put the MainView.html in com/andrei within your classpath (e.g. inside your resources dir)

– cfrick
Nov 14 '18 at 15:11





find design file MainView.html in com.andrei. Put the MainView.html in com/andrei within your classpath (e.g. inside your resources dir)

– cfrick
Nov 14 '18 at 15:11













Im sorry but i do not understand, can you explain , I must put MainView.html in com/andrei , i put it , but nothing changed

– Andrei Gospodarenco
Nov 14 '18 at 15:18





Im sorry but i do not understand, can you explain , I must put MainView.html in com/andrei , i put it , but nothing changed

– Andrei Gospodarenco
Nov 14 '18 at 15:18












1 Answer
1






active

oldest

votes


















2














The right location is most likely /src/main/resources/com/andrei/MainView.html.






share|improve this answer























  • thanks for help Leif

    – Andrei Gospodarenco
    Nov 15 '18 at 9:24










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53303265%2funable-to-find-design-file-in-vaadin%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














The right location is most likely /src/main/resources/com/andrei/MainView.html.






share|improve this answer























  • thanks for help Leif

    – Andrei Gospodarenco
    Nov 15 '18 at 9:24















2














The right location is most likely /src/main/resources/com/andrei/MainView.html.






share|improve this answer























  • thanks for help Leif

    – Andrei Gospodarenco
    Nov 15 '18 at 9:24













2












2








2







The right location is most likely /src/main/resources/com/andrei/MainView.html.






share|improve this answer













The right location is most likely /src/main/resources/com/andrei/MainView.html.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 15 '18 at 7:38









Leif ÅstrandLeif Åstrand

1,885510




1,885510












  • thanks for help Leif

    – Andrei Gospodarenco
    Nov 15 '18 at 9:24

















  • thanks for help Leif

    – Andrei Gospodarenco
    Nov 15 '18 at 9:24
















thanks for help Leif

– Andrei Gospodarenco
Nov 15 '18 at 9:24





thanks for help Leif

– Andrei Gospodarenco
Nov 15 '18 at 9:24



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53303265%2funable-to-find-design-file-in-vaadin%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo