Hi Magnus,

I'm sorry I didn't respond earlier. We just found out yesterday afternoon that
the Iterate tag issue is not a problem. I didn't recompile it yet for the
three argument method setAttribute, but you said before that you fixed this.

Please close the other setAttribute report for 1.0 internal build 3. This is
not a problem, it just took us a long time to sort it out.

This current problem below confuses me a bit. The resulting code if it made it
thru the parse phase would compile but it doesn't make it thru the parse
phase. I couldn't find anything in the spec that would say this is not an okay
usage but couldn't find anything that says it's okay either.

The main goal in the code was to make the creation of the bean right where I
wanted it(readability, maintainability etc). The BluePrints state this type of
JSP controller is desired and actually they are easy to write and change so I
hope this is allowed.

Thanks for all the help,
Hope to see your team at JavaOne.

Eric :-)

p.s. I guess we may have to discuss this with the Sun Team. Do you want to
forward this message to them?

Magnus Stenman wrote:

> Hi, first off; didnt you get the response to your other mail/report?
> As for the bean the code below looks as if it should fail ("per the spec").
> Bean definitions apply to "the rest of the page" even if of course they can
> only be used within any potential { } they're defined inside. The compiler
> is more or less "dumb" to the java code presented and passes it on as
> templates for the java source so it doesnt not consist of any rules for
> checking scope via parsing it etc. We'll try to hunt down any specifics on
> redefining a bean with the same name + scope in a page and if we can't find
> any in the spec we'll discuss it with Eduardo (JSP 1.1 and 1.2 lead).

>
>
> /Magnus Stenman, the Orion team
>
> > Hi,
> > I'm getting the following error in Orion 1.0rc1. This is the second
> > error I've post so please respond. Both are show stoppers since we have
> > one camp using Resin and this works as well as the previous interface
> > type error I posted. Orion is getting so unfavorable press here in our
> > shop.
> > --------------------
> > 500 Internal Server Error
> >
> > Error parsing JSP page /ordercontrol.jsp line 88
> >
> > Bean 'address' already defined
> > -------------------
> >
> > Here is the JSP code. It seems I should be able to do this but can't
> > find it in the spec about the scope of objects in the JSP body. The code
> > is part of a control JSP. I don't want to create an Address unless I'm
> > in one of these if statements. Also this is a parse problem so I'm
> > wondering what references from the spec you are using. useBean say
> > create if you can't find it-it doesn't say anything that would lead me
> > to believe you can't do this below.
> >
> > Thanks,
> > Eric
> >
> > // 3a. submit account
> > if(action.equals("submitaccount")) {
> > %>
> >   <jsp:useBean id="address" class="com.ratex.common.Address"
> > scope="page" />
> >   <jsp:setProperty name="address" property="address1"
> > param="addressaddress1" />
> >   <jsp:setProperty name="address" property="address2"
> > param="addressaddress2" />
> >   <jsp:setProperty name="address" property="city" param="addresscity" />
> >
> >   <jsp:setProperty name="address" property="state" param="addressstate"
> > />
> >   <jsp:setProperty name="address" property="country"
> > param="addresscountry" />
> >
> >   <jsp:useBean id="account" type="com.ratex.common.Account"
> > scope="session" />
> >   <jsp:setProperty name="account" property="address"
> > value="<%=address%>" />
> >   <jsp:setProperty name="account" property="userId" param="userId" />
> >   <jsp:setProperty name="account" property="firstName" param="firstname"
> > />
> >   <jsp:setProperty name="account" property="lastName" param="lastname"
> > />
> >   <jsp:setProperty name="account" property="email" param="email" />
> >   <jsp:setProperty name="account" property="phone" param="phone" />
> >
> >   <jsp:useBean id="order" type="com.ratex.estore.order.Order"
> > scope="session" />
> >   <jsp:setProperty name="order" property="account" value="<%=account%>"
> > />
> >   <jsp:setProperty name="order" property="address"
> > value="<%=account.getAddress()%>" />
> > <%
> >   String shipTo = request.getParameter("shipto");
> >   if(shipTo != null && shipTo.equals("on")) {
> >     // from another place should check to see if it exists
> >
> > application.getRequestDispatcher("/addressform.jsp").forward(request,
> > response);
> >     return;
> >   }
> >   else {
> > %>
> > <%
> >
> > application.getRequestDispatcher("/orderreview.jsp").forward(request,
> > response);
> >     return;
> >   }
> > }
> > %>
> >
> > <%
> > // 3b. submit address
> > if(action.equals("submitaddress")) {
> >    Order order = (Order)session.getAttribute("order");
> > %>
> >   <jsp:useBean id="address" class="com.ratex.common.Address"
> > scope="page" />
> >   <jsp:setProperty name="address" property="address1" param="address1"
> > />
> >   <jsp:setProperty name="address" property="address2" param="address2"
> > />
> >   <jsp:setProperty name="address" property="city" param="city" />
> >   <jsp:setProperty name="address" property="state" param="state" />
> >   <jsp:setProperty name="address" property="country" param="country" />
> >
> >   <!-- set on order above -->
> >   <jsp:setProperty name="order" property="address" value="<%=address%>"
> > />
> > <%
> >   // from another place should check to see if it exists
> >   application.getRequestDispatcher("/orderreview.jsp").forward(request,
> > response);
> >   return;
> > }
> > %>
> >
> >


Reply via email to