Win a copy of Hands On Software Engineering with Python this week in the Jython/Python 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Changing request Attribute via Javascript  RSS feed

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there. I have an Attribute in the request, wich was set in may action like this:
request.setAttribute("imovelDefinido", "N");

Now I want to change it in my JSP when I click on a radio button, wich means the onclick event. I think the best (or the only) way is using javascript. How can I do it?

Thanks!
Rafael
 
Marshal
Posts: 67192
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Rafael Andrade:
I think the best (or the only) way is using javascript.



You are incorrect. There is no way to do it.

While the page is sitting in the user's browser for him or her to interact with it, there is no request active. No request means no request attributes. So what are you going to change?

The request that created the HTML page to send to the broswer is long since over. And until the user submits the page (or your Javascript initiates an Ajax request), no new request will exist.
 
Bear Bibeault
Marshal
Posts: 67192
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question indicates a fundamental misunderstanding regarding how JSP works and operates. Perhaps this article might be helpful.
 
Rafael Andrade
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You�re right. I�ll read the article.
Thanks alot for the answer!
And congratulations for the site, it�s the best one by far!
 
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!