• Post Reply Bookmark Topic Watch Topic
  • New Topic

Storing field value in java properties file.

 
pramod talekar
Ranch Hand
Posts: 367
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm writing a jsp where the user enters something in a text field and I want to store that value to my properties file in java.

What I wrote in <BODY> is :-



This is the function in <Head>:--


I get the message that ab can not be resolved.

Could you please explain the reason.

How to store it then ?

Please advise.
 
N Sahni
Ranch Hand
Posts: 55
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I don't think you can access javascript variables in JSP, as JSP is executed on server-side and all javascript modifications a done on client side.
In this case you need to post this input value to server using servlet or Ajax method and store it in a property file.
 
pramod talekar
Ranch Hand
Posts: 367
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi N Sahni,

Thanks for the response.

I'm in a situation where my index.jsp form should go to a servlet only when the input field is not empty otherwise it should just throw out an alert box.



The problem here is that it always goes to the servlet and doesn't care if the field is empty or not.
How to use the execution of alert box in the flow of the program.

Please advise.
 
pramod talekar
Ranch Hand
Posts: 367
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I got the solution for this, have added this method:

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!