Forums Register Login

Good way to organise a large web application

+Pie Number of slices to send: Send
Hi,

Is that ok, to put dynamic content in a different directory
like JSP/*.jsp

If i do so, URL's like www.xyz.com/JSP/MainMenu.jsp will look weird instead of www.xyz.com/MainMenu.jsp

Could anybody suggest a decent way?
+Pie Number of slices to send: Send
By using the Struts web framework, users navigate throughout the application via Controller. What this means it that the .jsp file extension is never displayed in the web browser. You configure the Controller to forward the user to the JSP page in the struts-config.xml file.

If you map your Actions to a *.htm extension and store the JSP pages in a 'pages' directory, a URL to the main page will be:

www.xyz.com/pages/main.htm

Actually, the physical directory name can be anything you want it to be. For example, you can store the JSP files in a XYZJSPPAGES directory, and still map the actions to:

www.xyz.com/pages/main.htm

The only place that you put the real directory and file name is in the struts-config.xml file.

All URLs point to Actions, not JSP pages.
[ October 06, 2008: Message edited by: James Clark ]
+Pie Number of slices to send: Send
Use of Struts for this is not required. Struts is merely one way to create a properly structured application.

Please see this article for more information.
+Pie Number of slices to send: Send
Thanks for reply,

Could you tell which tags to use in struts-config.xml for this purpose
+Pie Number of slices to send: Send
Pratap koritala, do you have any experience coding with the Struts API?
[ October 07, 2008: Message edited by: James Clark ]
+Pie Number of slices to send: Send
I am just started building some helloworld Struts applications.....
+Pie Number of slices to send: Send
Sounds good.

The following servlet-mapping element is used to map your action classes to a specific file extension. Below is an example.



The configuration of your Action classes is done with action elements contained within the action-mapping element.

I guess I've been abducted by space aliens. So unprofessional. They tried to probe me with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 918 times.
Similar Threads
wants to hide the path of url
Url Abstraction
tomcat configuration
Passing values in URL to Java Web application
struts url-pattern problem..
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 19:17:37.