• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

<s:textfield error

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I can get the values from the db and set the values.

In the action file :

private String test; and setter & getter method.

I am not able set the values in the jsp file

<s:textfield name="test" value="%{test}">

But i get the values from the text box & using out.println(test);

<input type="text" name="test" id="test" value ="<%=test %>"/>

Please guide me


Thanks & regards,

Siva N P
 
Ranch Hand
Posts: 1211
Mac IntelliJ IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


<s:textfield name="test" value="%{test}">



That should work.
If you have a getTest() method in your Action class, you can simplify it to -
<s:textfield name="test" />


<input type="text" name="test" id="test" value ="<%=test %>"/>


This, OTOH, should not be working, unless you are creating a variable 'test' in your JSP.
 
siva np
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Sir,

I have changed the coding.

But it didn't work.


My action page is salesAction.java


My jsp page name is sales.jsp


The output is not coming.

regards,

Siva N P
 
Sonny Gill
Ranch Hand
Posts: 1211
Mac IntelliJ IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For those struts tags to work, the Action must be present on the value stack.
That requires that your interceptors are set up correctly, and you are getting to the JSP by invoking an Action.

Have a look at the A Request Walk-through section in this InfoQ article.

HTH
 
reply
    Bookmark Topic Watch Topic
  • New Topic