You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Anshuman <An...@gsr-inc.com> on 2001/03/24 00:48:50 UTC

Iteration using the Vector Object

Hi!,

I have a vector object in my FormBean.

and have respective get and set methods for that Vector Object.  The vectore
object contains my Detail Class Objects.

Can anyone have any idea as to How can I use this Vector using "iterate " or
any other tag in Struts to display the Information of the Detal Class object
row by row where each row represents complete information form a single
Detail Class.



Thanks for all the help.

Regards
Anshuman Nanda


-----Original Message-----
From: Suriyanarayanan, Senthil Kumar
[mailto:senthilkumar.suriyanarayanan@capitalone.com]
Sent: Friday, March 23, 2001 3:41 PM
To: struts-user@jakarta.apache.org
Subject: How to use html:errors ?


How do you make the errors shows up on the generated page.? Here is the code
snapshot..

LogonForm.java
public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request)
	{
		if(password == null || !password.equals("password"))
		{
			ActionErrors aes = new ActionErrors();
			ActionError ae = new ActionError("Please type the
valid password");
			aes.add("?", ae);
			return aes;
		}
		return null;
	}
What should I put at the place of '?' in the above add method 

struts-config.xml

	<form-beans>
	    <form-bean name="logonForm" type="package.LogonForm"/>
	</form-beans>


  <action-mappings>
    <!-- Logon Action -->
    <action    path="/logon"
               type="package.LogonAction"
               scope="request"
               name="logonForm"
               validate="true"
               input="/logon.jsp">
               <forward name="successpage" path="/success.jsp" />
    </action>
  </action-mappings>


logon.jsp

<html:errors/>
<html:form action="logon.do">
	UserId: <html:text property="userId" size="15" maxlength="15"
redisplay="false" />
	Password: <html:password property="password" size="16"
maxlength="16" redisplay="false" />
	<html:submit/>
</html:form>

I saw one of the postings talking about saveErrors method. It belongs to
Action Object, and I how do
I get reference to action object from the validate method?

Thanks in advance,
Senthil Kumar.S
 
**************************************************************************
The Information transmitted herewith is sensitive information intended only
for use to the individual or entity to which it is addressed. If the reader
of this message is not the intended recipient, you are hereby notified that
any review, retransmission, dissemination, distribution, copying or other
use of, or taking of any action in reliance upon, this information is
strictly prohibited. If you have received this communication in error,
please contact the sender and delete the material from your computer.

init'ing session beans in an Action

Posted by "G.L. Grobe" <ga...@grobe.org>.
I finally have my struts tags working. Next step. My app has jsp pages that
populate ActionForms. I now have to populate my entity beans, but one step
at a time, so I'm trying to instantiate session beans from my Action classes
(which will later operate on the entity beans) and I'm not sure how this is
done. I thought that the JNDI init context stuff would go in the init()
method of a servlet, but with Actions, not sure if this is correct as I
couldnt' override the init() method. Or should my action class be extending
from ActionServlet instead of Action?

Any help much appreciated.


Actions and Session Beans

Posted by "G.L. Grobe" <ga...@grobe.org>.
I've finally got struts taglibs and a few Actions working in my jsp pages,
but I'd like to be able to populate some EJB's with the model data from the
ActionForms. I'm not sure how to do this. I've got a session bean which
operates on an entity bean which I will then send to another machines java
app, but I'm not sure how to implement the session bean in my Action.

Anyone know of examples or where I may find some refs on doing this?