Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help with DD  RSS feed

 
Luke Kamble
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am trying to meke a web app.
All requests are routed through one single servlet(<url-pattern>/*</url-pattern>).
From url i extract all the informations to invoke proper controllers and models.
The problem is, when i finish with the controller, i would like to forward all the data from controller to a jsp file. But when i am trying to do so, it fails couse of <url-pattern>/*</url-pattern>, and it goes again to a specified servlet which maps to <url-pattern>/*</url-pattern>.
Is there any way to achive this(routing all requests to one servlet and then forwarding the data to a specific jsp file based on url).

Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Mapping /* is a horrible thing to do. Do you also want all image, JavaScript and CSS file references to be routed to the servlet? Of course not.

Use a reasonable mapping using a specific prefix like /whatever/*.
 
Luke Kamble
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:No. Mapping /* is a horrible thing to do. Do you also want all image, JavaScript and CSS file references to be routed to the servlet? Of course not.

Use a reasonable mapping using a specific prefix like /whatever/*.



Isn`t there any other way to specify url mapping. Like apache who has a .htaccess file, where you can specify route all execpt .jpg .gif etc.?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could try mucking around with the order of mappings, but to be honest I don't think you'll get it to work the way you want without a lot of mess, if at all.

Bottom line: experienced web developers do not even attempt to map /*. It's a rather novice mistake to make.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!