dcsimg
How to assign values from resource file to java/JS variable using struts.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Raj_Mit
Posted On:   Tuesday, June 11, 2002 02:08 PM

I am using struts in JSP pages. I have a resource file defining the error messages. I can display the error message with-in BODY element of html page using: My question is how do I assign this value to a java or javascript variable. If I can assign to a variable, then I can pass it to other javascript functions that I have. I want something like: <% String errorstr = ; %> Obviously, the above does not work. The other way I know is to use the resourcemanager from servletcontext, but I wanted to use the struts tags if possible. Any suggestions/help is appreciated.    More>>



I am using struts in JSP pages.
I have a resource file defining the error messages. I can display the error message with-in BODY element of html page using:




My question is how do I assign this value to a java or javascript variable. If I can assign to a variable, then I can pass it to other javascript functions that I have. I want something like:


<%


String errorstr = ;


%>


Obviously, the above does not work.


The other way I know is to use the resourcemanager from servletcontext, but I wanted to use the struts tags if possible.


Any suggestions/help is appreciated.


Thanks!


Rajeev

   <<Less

Re: How to assign values from resource file to java/JS variable using struts.

Posted By:   bala_gurram  
Posted On:   Monday, June 17, 2002 06:17 PM



Hi Rajeev,

You can assign the value to a java or javascript variable
like





Bala Gurram.

About | Sitemap | Contact