• 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

html:link with bean:define param, value gone in action ?!

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, business case is the registration of employees' vacations by other colleagues. Of course these may not know all data like organisational units, employeeId and so on. So there is a main JSP offering edit fields for all of this, and two buttons, one to send the complete vacation data (submit) and one to search by partialy entered data for matching colleagues. And returning to the prefilled edit JSP after selectig one search result.

Therefor at two points of my app I use dynamic parameters with html:links.

The list of persons (the search result) is displayed using this:

This works fine and in the PreFillAction I fetch the employee data with the help of the ID and prefill all edit fields ...

Now I wanted to build soemthing similar for the two needed buttons on the EditJSP.
One 'fixed' link for the submit and one dynamic with the familyname as param for the SearchAction.

This is basicly like the above:



JSP looks fine and all, but for some totaly not understandable reason the param doesn't reach the Action, it is allways NULL.

I tried retrival from the struts form, from sesssion Param or as simple request param, nothing worked...

Any clues?

[ December 02, 2007: Message edited by: Oliver Thoms ]
[ December 03, 2007: Message edited by: Oliver Thoms ]
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure. When you run the app does the link look correct? Like: "http:/<server>/<app>/vacation/search.do?familyname=smith"?

If so then I would look closer at (or post here) the action mapping, the form and the action class.

BTW, it seems like you could get rid of the bean:define tag if you used the paramId attribute of the html:link tag. You could also get rid of your scriptlet in the img tag if you used the html:img tag with the page attribute.

- Brent
 
O. Thoms
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Struts config snipplet



The link looks fine on the JSP, but (thanks for the hint) it allready has an empty aram.
So my guess:
Since the familyname just got entered it is not yet stored in the bean.
The form will just be processed when the request is posted.
Could it be, that the bean is not yet populated?!

Still tinkering around....

[ December 03, 2007: Message edited by: Oliver Thoms ]
[ December 03, 2007: Message edited by: Oliver Thoms ]
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That sounds right. The html tags are processed when the page is generated. In order to use a value that was entered into the form you would have to use some JavaScript to get at the value. JavaScript is not my strong suite, so I will leave it to others to help with that solution.

- Brent
 
He baked a muffin that stole my car! And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic