Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Good way to organise a large web application  RSS feed

 
Ramya Chowdary
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66184
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ramya Chowdary
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply,

Could you tell which tags to use in struts-config.xml for this purpose
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pratap koritala, do you have any experience coding with the Struts API?
[ October 07, 2008: Message edited by: James Clark ]
 
Ramya Chowdary
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am just started building some helloworld Struts applications.....
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!