This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

JSP pages-passing variables

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am creating a jSP page.THe basic idea is
1.First screen asks for the input say- report id.User enters the value.
This is the textbox of the first screen.
<input name="ReportID" id="ReportID" type="TEXT" class="textfieldfont" size="30" maxlength="25" onChange="allowSubmit()">

2.SEcond screen displays the report-Id and emp-Key in two textboxes ,fetching data from database based on report_id provided.

IN the second screen the data is loaded to the textbox as follows
String sql = "SELECT * FROM CONCUR_ADMIN.CT_REPORT WHERE REPORT_ID LIKE '" + request.getParameter("ReportID") + "'", qry, cName = "";

i can EDIT the emp-key textbox value in this page.

3.on clicking the submit button another jsp page is called which updates the values and reloads the second screen

4.THe problem is:When the 2nd screen is uploaded with updaqted values,the texboxes are blank.IT is not populated with new values(no values at all in textboxes).
But,in the database the value is updated.

5.i think I am not storing the report id in a variable,so the problem occured,not sure.

6.please tell me with eg how should i correct this.

7.pLease help
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sruthi Surendran:
I am creating a jSP page.THe basic idea is
1.First screen asks for the input say- report id.User enters the value.
This is the textbox of the first screen.
<input name="ReportID" id="ReportID" type="TEXT" class="textfieldfont" size="30" maxlength="25" onChange="allowSubmit()">

2.SEcond screen displays the report-Id and emp-Key in two textboxes ,fetching data from database based on report_id provided.

IN the second screen the data is loaded to the textbox as follows
String sql = "SELECT * FROM CONCUR_ADMIN.CT_REPORT WHERE REPORT_ID LIKE '" + request.getParameter("ReportID") + "'", qry, cName = "";

i can EDIT the emp-key textbox value in this page.

3.on clicking the submit button another jsp page is called which updates the values and reloads the second screen

4.THe problem is:When the 2nd screen is uploaded with updaqted values,the texboxes are blank.IT is not populated with new values(no values at all in textboxes).
But,in the database the value is updated.

5.i think I am not storing the report id in a variable,so the problem occured,not sure.

6.please tell me with eg how should i correct this.

7.pLease help



Hi,
What i understood from your question is that after pressing the submit button you are not able to see the details in the next page if i am right with your question if this is your problem it is very simple what you have to do just retrive the details in the next jsp page by like
<% String username=request.getParameter("username");%> here the username is the property name of that jsp.
here i have given as username but in your case it is report id.
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
My understanding from your explanation is From jsp2 on click of submit button you re calling jsp3. There you are updating the record and then redirecting to jsp2 page. If i am right, then as you said that the Report_ID is not there in the request scope. So either put the Report_ID in session or pass the Report_ID to the jsp3 as well by hidden text box from jsp2 to jsp3 with the same name of the Report_Id textbox which you have given in the in the jsp1.

I hope i am clear to you.
[ November 30, 2007: Message edited by: kesava narayana ]
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I got your question, you want to access the report.Id in 3rd page means you should save the report.Id value in requset(or session, application,page according to your use)scopes.

You just write in your 2nd Jsp,

<%String report.Id=request.getParameter("testbox_name");
request.setAttribute("report.Id",reportId);
%>

Now you get the report.Id in 3 page by using

<%=rquest.getAttribute("report.Id")%>

I think this is helpful for You.......
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic