• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

How do you pass a string from servlet to jsp if jsp is on another server?  RSS feed

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you pass a string from servlet to jsp if jsp is on another server?

Please provide me solution for this.

Thanks
Cherry
 
Ranch Hand
Posts: 2908
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the query string with the JSP and redirect to the URL., like
 
Cherry Gupta
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Sagar for quick response

but stil I m not able to get that how I set a string in servlet and get that in jsp if jsp is on another server?

please provide me some kind of code for it.

Thanks
Cherry
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I told you to use the "query string" and to access it in the JSP page use request.getParameter(). EL for the same:


 
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exactly what sequence of events are you trying to create here?

If you want the servlet to redirect to the other server, you have to use a URL containing the parameter like Sagar said. See the HttpServletResponse sendRedirect() and encodeRediretURL() methods.

If you have some other sequence of events in mind, kindly explain.

Bill
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as sagar said now at another server jsp page code
 
Author and ninkuma
Marshal
Posts: 66806
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

amrish sharma wrote:request.getparametre('param').toString().trim();


If you are going to post code, please make sure that it is accurate. The spelling of the method is getParameter() not "getparametre", and strings must be in double quotes, not single quotes.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please create output and set the value that you want to send to next server hidden field in it. and on load of the of that html page redirect to the server url.




Thanks
Sarbjeet Singh Sidhu
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
right but you have to flush
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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