This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

fill data by condition in second jsp page  RSS feed

 
Babu Singh
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have two Jsp's pages.
on main.jsp have some list of school. from there i can go home page of any school. home.jsp represents a school home page.
on home.jsp have some link like message, vision, addmission, result etc.
when i click on any of these link then i get some description in a table area on home page of that school.
it show description only when i click on these link otherwise table area in home.jsp show blank.

when i go from main.jsp to home.jsp, table area of home.jsp show blank. if i fill this table area by static data in Home.jsp. after that when
i click to message link, then message will show after static data.

my problem is when i go from main.jsp to home.jsp, table area of home.jsp show blank.
how i fill this area on Home.jsp by condition.

here some data of Jsp's.

main.jsp



home.jsp


please help
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please edit your posted code with proper indentation.
 
Babu Singh
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

in home.jsp have some link like message, vision, addmission etc.
when i click on any of these link then i get some information in a table area in a home page of that school (which is Home.jsp).
it show information when i click on these links otherwise table area in home.jsp show blank.
how i fill this table area by condtion so that when i move from main.jsp to Home.jsp, it can show some data.

main.jsp


Home.jsp


please suggest
 
praneel shah
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are many ways to do that.

The simplest way is using the persistent object HttpSession. You can store the strUser in the HttpSession object in test1.jsp before getting it in test2.jsp. In test1.jsp, you do
session.setAttribute("user", struser);


In test2.jsp, you do
String user = (String)session.getAttribute("user");

 
Babu Singh
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i am asking when i move from main.jsp to Home.jsp, table area of Home.jsp show blank. how i fill up this area.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!