Bear Bibeault wrote:You should not any have variables or any other code in the JSP page. Perform the data handling in the servlet controller. Keep track of what "page" you are on using a hidden variable in the form.
Bear Bibeault wrote:
asaf shay wrote:1)I told you that if I want a user saves to Favorites Result of seraching by some thing i have to know the query string and from that i know what he searching for
That still does not mean that the name of a JSP needs to be used in the URL. Why do you think you need a JSP name? Any URL that gets the info can be bookmarked.
2)Apparently we have a misunderstanding ,the file bla.jsp in the WEB-INF
I can barely see the text in the video, but I do not see where WEB-INF is any prat of the url or path.
WebContent is not WEB-INF.
Bear Bibeault wrote:
asaf shay wrote:1)if you don't let the user the option to save to favorite you limit him .and in my site i don't want to limit .
Please show me where I said you should not allow bookmarks. I never said that. Anywhere.
I said you do not need the name of the JSP to create bookmarks. You can bookmark any URL.
2)i just upload to youtube how i can,i put file under WEB-INF that call bla.jsp and i open it /
That video does not show anything being accessed from inside WEB-INF.
Bear Bibeault wrote:1) No, you do not need to bookmark JSP files. In fact, you should not. A JSP without its page controller makes no sense. You should create URL mappings that make sense. JSP names should never be part of a URL.
2) Wrong. You cannot open a JSP that is under WEB-INF by using a URL in the browser.
Bear Bibeault wrote:Your second url is not the correct way. The URL should be to the servlet page controller and not even mention the JSP. Who cares what the JSP is named? The end user sure doesn't.
See this article if this pattern isn't familiar.
To prevent JSPs from being directly navigated to, they are placed somewhere under WEB-INF. This prevents them from being directly served, but allows page controllers to forward to them.
Bear Bibeault wrote:You asked how to make sure that using the URL with no path goes to the right place. The welcome list in web.xml tells the app what to do when there is no path. By default, it first goes to index.jsp. You change that behavior in web.xml.
Bear Bibeault wrote:You can make the url of the page controller for the first page an entry in the welcome-list in web.xml.