is there anyway that i can have localhost:8080/proj/products.jsp call the action and return the result to the products.jsp
without typing localhost:8080/proj/catalog.action
Balu Sadhasivam wrote:
is there anyway that i can have localhost:8080/proj/products.jsp call the action and return the result to the products.jsp
without typing localhost:8080/proj/catalog.action
Why do you want to do that ? Check out Logic:redirect , if that could help you.
Also where did you place the jsp ( cannot be under WEB-INF)
David Newton wrote:Files under WEB-INF are not available to the browser.
In general, Struts apps should always access their pages through actions and avoid mixing "plain" JSP addresses. I don't understand why you'd want to do that either, or what's wrong with just typing "products.do" (or, in your case, the longer "products.action"). What's it matter? Why complicate things?
David Newton wrote:The *browser* is not able to access resources under WEB-INF. The *server* can.
David Newton wrote:...
No. The browser is accessing the action URL. The *server* is accessing the JSP.
David Newton wrote:In your JSP example URL the JSP isn't under WEB-INF.
You wrote:When I do http://localhost:8080/Final_Project/login.jsp it works fine.
David Newton wrote:
You wrote:When I do http://localhost:8080/Final_Project/login.jsp it works fine.
That JSP is not under /WEB-INF. It's either in the root (if you're deploying to the "Final_Project" app context) or under /Final_Project if you're deploying to the root context.
You may *have* a login.jsp under /WEB-INF, but it's not the one being served when you use the above URL.
Don't get me started about those stupid light bulbs. |