• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing a value from a JSP page to an Action to get some data after processing

 
Stan Pak
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I want to make this logic.

[JSP page] ---pass a value---> [Action class] ---select using the value and return---> [JSP page]

The value is Product Group ID.
The Action class should return a Product List to the JSP page by selecting products using the Product Group ID.

So I'm using Struts2 Tag on the JSP page like this..


Is there something wrong with it?
Because that code didn't return any value.

I tested the method(getGroupRelData) like this.


Nothing printed. No error.

The value printerGroupID in the JSP page is ok. Because I tested the value like this.

I could see the value when I ran the JSP page.

I think there is something wrong with this sentence.
<s:iterator value="@collect.CollectMainData@getGroupRelData('#printerGroupID')">

Is it right? I'm looking forward to your answer. Thanks.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remove the "#".
 
Stan Pak
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you said, I removed the "#" and tested, but nothing changed.
The method wasn't even executed.

Is this right?(especially the bold part)
<s:iterator value="@collect.CollectMainData@getGroupRelData('printerGroupID')">
 
Stan Pak
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Resolved!

That because I didn't set to access static method.

I made a file "struts.properties" and write "struts.ognl.allowStaticMethodAccess=true" in the file.

Hooray!
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, yes, that'd do it--glad you figured it out!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic