• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use Bean:define

 
Muni Jampana
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am trying to build a search page for movie webite.. I am able to show the movie names when I search as links.
My requirment is when I clicked on the movie name I should be able to view the movie details. For which I used bean efine tag.

<logic:iterate id="result" name="searchform" property="arl">
<bean efine id="paramId" name="result" property="movie_id" />

<%params.put("passId",pageContext.findAttribute("paramId"));
pageContext.setAttribute("params",params);%>

<html:link action="/DisplayMovieDetails" name="params">
<bean:write name="result" property="movie_name" /></html:link>
</logic:iterate>

arl is my arraylist.
searchform is my formbean.
When I say Object requestId = request.getParameter("passId");
I am not getting the value:
my struts config is
<action path="/DisplayMovieDetails" type="magfa.actions.DisplayMovieDetailsAction" name="moviedetailsform" scope="request" input="/SearchResults.jsp">
<forward name="success" path="/MovieDetails.jsp">
</forward>

Please tell me the error in this. If possible help me doing this in anyother form.
Thanks
 
Brent Sterling
Ranch Hand
Posts: 948
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you just passing one parameter? Looks like it is named "passId". If you just need to pass this one parameter on the url then you should be able to use this code:


- Brent
 
Muni Jampana
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Brent it is working..
But I have a doubt.

When do we use bean efine? In which scenario?
 
Brent Sterling
Ranch Hand
Posts: 948
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a link to the docs for the bean efine tag (the 1.1 version of the docs):
http://struts.apache.org/1.1/userGuide/struts-bean.html#define

The bean efine tag is a way of defining a variable that can then be used in some scriplet code.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic