Unable to find design file in Vaadin
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
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
add a comment |
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
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
find design file MainView.html in com.andrei
. Put theMainView.html
incom/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
add a comment |
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
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
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
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
java vaadin
asked Nov 14 '18 at 15:08
Andrei GospodarencoAndrei Gospodarenco
8919
8919
find design file MainView.html in com.andrei
. Put theMainView.html
incom/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
add a comment |
find design file MainView.html in com.andrei
. Put theMainView.html
incom/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
add a comment |
1 Answer
1
active
oldest
votes
The right location is most likely /src/main/resources/com/andrei/MainView.html
.
thanks for help Leif
– Andrei Gospodarenco
Nov 15 '18 at 9:24
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
The right location is most likely /src/main/resources/com/andrei/MainView.html
.
thanks for help Leif
– Andrei Gospodarenco
Nov 15 '18 at 9:24
add a comment |
The right location is most likely /src/main/resources/com/andrei/MainView.html
.
thanks for help Leif
– Andrei Gospodarenco
Nov 15 '18 at 9:24
add a comment |
The right location is most likely /src/main/resources/com/andrei/MainView.html
.
The right location is most likely /src/main/resources/com/andrei/MainView.html
.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
find design file MainView.html in com.andrei
. Put theMainView.html
incom/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