• 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

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

 
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 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.
 
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
Remove the "#".
 
Stan Pak
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
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
Ah, yes, that'd do it--glad you figured it out!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic