• 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

Beginner Struts Problem (Solved)

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to learn some struts2, and am running into the following problem making a trivial web application: I want to use one jsp as a form, then pass the data on to an action class and have it available to print on a second jsp. My struts.xml file is:


struts.xml


Here is the form code from the input class:
NameInput.jsp



Here is a relevant excerpt from the display class:
NameDisplay.jsp



However, when I submit data from my form it doesn't get carried over. I have a check in my action class (world.hello.Person) that makes sure that the name and number values were set (and I can print them to the console). They are getting through--and so the success result is displaying.

Here is the code from the action class
Person.java


If anyone has any input as to what I'm doing wrong, that would be incredible. My gut says that I need to somehow bind the Person to the http request (like how you would with a standard filter). Also, I switched to the <s:property> tag from just ${person.name} style because I didn't have a name for the parmater. Anyway, thanks in advance!

John

 
John Sears
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Never mind, I realized I needed to add



It works fine now.
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you manually add struts-tags.tld fine in the WEB-INF directory?? You don't need to do that. You need to use a taglib directive like this



The struts tld file is in the struts jar file so it is not needed again in WEB-INF folder...
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I marked as solved in the subject.

But Ankit is correct; it shouldn't be necessary to extract the TLD file.
 
John Sears
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ah, thank you. I will give that a shot.
 
reply
    Bookmark Topic Watch Topic
  • New Topic