• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Cherry Gupta
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
 
Sagar Rohankar
Ranch Hand
Posts: 2907
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: 2907
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:


 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
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
 
amrish sharma
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as sagar said now at another server jsp page code
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64992
86
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.
 
sarbjeet sidhu
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
 
amrex sharma
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
right but you have to flush
 
gudadawar de
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic