Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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
  • 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
  • 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
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!
 
reply
    Bookmark Topic Watch Topic
  • New Topic