• 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

URLs and appending parameters

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to pick and choose what parameters to show and what parameters to not show in a URL?

I have a controller servlet that forwards the request/response to other servlets depending upon one given parameter.

Here is a snippet of code for the controller servlet:


In the other servlets, there is an array of a parameter. What I don't want is the "arrayed" parameter to be appended to the URL. example: http://localhost:8080/myApp/exportData?type=pdf?customerId=1?customerId=2?customerId=3

Here is a snippet of code for the "other" servlet:


I want the controller servlet to list the one parameter in the URL. example: http://localhost:8080/myApp/exportData?type=pdf INSTEAD OF http://localhost:8080/myApp/exportData?type=pdf?customerId=1?customerId=2?customerId=3. Is this possible?
 
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
A forward does not create a new request. The request, and all its parameters, is the same for the original servlet as well as the one to which it is forwarded.
 
Nicole Jones
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:A forward does not create a new request. The request, and all its parameters, is the same for the original servlet as well as the one to which it is forwarded.



Thanks. I'm going to try to use redirects w/ session attributes.
 
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
Why? What's wrong with the forward? just ignore any parameters you are not interested in.
 
Nicole Jones
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what do you mean? are you referencing filters and/or wrappers? if so, too messy.

Bear Bibeault wrote:Why? What's wrong with the forward? just ignore any parameters you are not interested in.

 
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
Who said anything about filters and wrappers?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic