Chris, i think what David is trying to say is that such a test of authorization does not belong in a tag (because of the nesting problem). An easy and (non-javascript!) way of dealing with this is to in the Action *before* the jsp is shown, determine what the authority of the user is and then display the correct jsp. Since I think the original problem was to not have two different jsps, an appropraite include can be used instead (decide at run-time which include to use) and thus reuse the form. (Though in my experience, (vast though it is *not*!), reusing jsps is just a headache. Writing and maintaining two or more jsps is not that much extra work especially if you keep them dumb (like you are supposed to).. just my opinion though..)
Regards, Geeta > -----Original Message----- > From: CRANFORD, CHRIS [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 22, 2004 3:11 PM > To: 'Struts Users Mailing List' > Subject: RE: Different form tags on same jsp > > > Can someone illustrate an example of this? > > -----Original Message----- > From: Hibbs, David [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 22, 2004 2:51 PM > To: Struts Users Mailing List > Subject: RE: Different form tags on same jsp > > > You've got a tag nesting error, to be sure. This is like doing <tagA> > <tagB> > </tagA> > </tagB> > > ...or at least to a JSP compiler it is. > > The solution to your problem is that the form action > attribute (and onsubmit > attribute) can be a runtime expression. > > David Hibbs, ACS > Staff Programmer / Analyst > American National Insurance Company > > > -----Original Message----- > > From: Pavlikus [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, June 22, 2004 12:53 PM > > To: Struts Users Mailing List > > Subject: Different form tags on same jsp > > > > > > Hi all. > > I want to reuse the jsp page with form where user can > Register or Edit > > Profile. > > > > I do like: > > > > <auth:if accept="GUEST_ROLE"/> > > <html:javascript formName="registrationForm"/> > > <html:form method="post" action="/PreRegisterUser.do" > > onsubmit="return validateRegistrationForm(this);"> > > </auth:if> > > > > <auth:if accept="USER_ROLE, MODERATOR_ROLE"> > > <html:javascript formName="editProfileForm"/> > > <html:form method="post" action="/EditProfile.do" > > onsubmit="return validateEditProfileForm(this);"> > > </auth:if> > > > > I expect what it render form tag for registrationForm if user have > > GUEST_ROLE role, and tag for editProfileForm is user have prepotent > > roles. > > > > But when jsp compiles - it show following error: > > -- The end tag "</auth:if" is unbalanced' > > > > What happen? Is it possible to render different form tags with this > > method at all? > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]