• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP html hidden varible?  RSS feed

 
Sam Doder
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am wondering I have a page with hidden html fields that store hidden varibles on my html page.

From my jsp page I am wondering if I can set and get these varibles on the html page.


I know I can set/get them with javascript on the html page but from another page jsp how can I get/set this hidden varibles if they are not passed by a form or query string.

Basically I have a popup menu that is an iframe with the iframe page being a jsp page. I want to set the hidden fields on the html page based on what the do in the menu iframe jsp page.

The html page contains the menu/iframe jsp page. But when I select stuff on the menu jsp page I need to set/get the hidden varibles in someway on the html page.

I know getElementById ,...etc DHTML ,...etc but this is not on the same page so it seems difficult to set a field on on page from javascript from another.

It's not like I can use session.setAttribute ...etc because the jsp menu is already generated. Is their something equivalent to session varibles or global varibles that mulitple html/javascript pages can see get/set. Because these if they where both jsp or asp or any other page that gets dynamically built then I would beable to use session stuff....

Note cookie's are out of the question I don't want to use these this would be to unpredicitable in all cases.

Thanks for any help
 
Richard Golebiowski
Ranch Hand
Posts: 213
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can. You can read or write to hidden tags of included JSP pages.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

If you got a input like <input type=hidden value="secret"name="hi"/>

you can get by request.getParameter("hi") at your servlet.

And you will be fine. =D
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!