File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Trying to use HTML values in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Trying to use HTML values in JSP" Watch "Trying to use HTML values in JSP" New topic

Trying to use HTML values in JSP

Jon Pepe

Joined: Dec 07, 2011
Posts: 5
Hi, I have a problem using a HTML value in my jsp page.

It doesn't work. I tried to do this before:

But I can't use parseInt like this. Can somebody help me?

I have a list ("nodoak") object where I have my "nodo" objects, with some atributes. I want use that HTML value to show a nodo or another. And then I want to change the value of the HTML node and reload the page.
Louis Bros
Ranch Hand

Joined: Jun 03, 2011
Posts: 54


Could you send the the value of your html element to your servlet via a get request and build your list there? Then display the list in the next view without conditional statements?

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

You can't do that. JSP knowns nothing about HTML or JavaScript which are interpreted on the browser after the generated page is formatted and sent to the client, So how could JavaScript be used on the server in the JSP code before it even exists?

Please read this article to understand how JSP operates and why that can never happen.

Then you can come back and describe what you are trying to accomplish (rather than how) and we can address how to best get it done.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Trying to use HTML values in JSP
It's not a secret anymore!