• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need help with DD

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic