• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

accessing <s:param> values in action

 
James Peter
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using ModelDriven action. From JSP I am creating url like below one. I have a variable form of Bean StudenBean which is having name and age fields. I implemented getModel() methods also.




At the server end if i try to access name variable value with below syntax

I am getting null value.


Please let me know if my way of doing is wrong.

Rgds
Peter
 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you look at the url that the s:url tag generated, are those parameters in it, and do they have values? Also, are you running the modelDriven interceptor?
 
James Peter
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply.

I created one anchor button to check the url.



Generated HTML code is


Not able to know how to check generated url.

I implemented ModelDriven to my action.

Rgds
Peter
 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have experience with the ajax tags so I don't know what the easiest way to display that URL is, but I think its pushed onto the stack, so I think you can use an <s:property value="student"/> to write it out.

Using the interface isn't enough to make model driven work. You need to use the modelDriven Interceptor as well (its what calls getModel on your action class to put the model on the stack). If you don't have this interceptor in your stack I don't think your model will get populated. To test you can put a println in your getModel method to see if it ever gets called (unless you wrote some code to call it).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic