You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ryan Cornia <rc...@dced.state.ut.us> on 2001/07/10 16:49:00 UTC

Error-page in web.xml

I'm hoping someone can help me understand this better. In web.xml, I have the following entries -
        <error-page>
            <exception-type>java.lang.Exception</exception-type>
            <location>/errorpage.jsp</location>
        </error-page>
       <error-page>
            <exception-type>javax.servlet.ServletException</exception-type>
            <location>/errorpagesrvlt.jsp</location>
        </error-page>

>From my understanding, anytime an Exception, or ServletException occurs in my application, it will call either errorpage.jsp or errorpagesrvlt.jsp. Is that correct? Does it matter if the exception occurs in a JSP or a servlet?

This seems to work in Tomcat, but with SilverStream, I don't get taken to the error page, but get the SilverStream generate error message.

In my errorpage.jsp I have -

<%@ page language="Java" isErrorPage="true"%>


is that right?

Thanks for any insite, this is driving me crazy.
Ryan



Sorry, another question for Iterate Tag

Posted by Frank Ling <st...@hotmail.com>.
Good Morning:

I have a question for the iterate property update with indexed tag.

Normally I use my own tag to show the real name of the iterate property for
update purpose, then just read them out from the HTTPRequest on my action
class, that works well until recently I have to add a upload feature to one
of my page which have Iterate tags. Since there aren't any HTTPRequest left
in my action class to read due to the multipart issue. Then I try to using
the ActionForm to handle the Iterate property for update.

I go through couple thread on this mailing list regarding for the indexed
tag on iterate tag for update purpose, and follow all the steps, still can't
get this thing works, please help me out.
Here are the step I did.

1) I get a object call InflowAttributes have three field, all have the
getters and setters.
    a. String name
    b. String type
    c. String value

2) I get form-bean call UserForm and have one of the field.
    a. InFlowAttribute[] attributes.
    have three method for the field.
    a.
    public InFlowAttribute[] getAttributes() {
        return this.attributes;
    }
    b.
    public void setAttributes(InFlowAttributes[] attributes) {
        this.attributes = attributes;
    }
    c.
    public InFlowAttribute getAttribute(int index) {
        return this.attributes[index];
    }
    3) I get jsp for the editing a userform, have couple thing made for this
indexed Iterate & Text tag.
    a) I get Dave Hay's indexed package install on top of the struts 1.0
release, both java and tld.
    b) I have struts-html.tld and struts-logic.tld define on top of my JSP
page.
    c) Here is my implementation for the iterate.
    <logic:iterate id="attribute" name="userForm" property="attributes">
        <tr>
        <td><struts:htmpProperty name="attribute" property="name"/><.td>
        <td><html:text name="attribute" property="value"
indexed="true"/></td>
        </tr>
    </logic:iterate>
    d) I have all the attribute[0..n].value set up properlly without any
problem.

    4) This JSP for editing userform will trigged a saveUser action. Here is
my problem, I can get all the other field from userform without problem
except attributes field is null, no matter whatever I do.

I know some thing I did wrong to cause the array attributes didn't get set
back to my userform, but just couldn't figure out why, If some people out
there can help me out, there will be really appreciated. Basically I try to
understand how the HTML form request get populate back to form bean.
especially how the "attribute[0..n].value" can get set back to array
"attributes" on my form.

By the way, until to this point, I still didn't put
enctype="multipart/form-data" on my form yet, so this will be pure Iterate
tag update issue.

Thanks in advance for the help.

Regards

FL


RE: Error-page in web.xml

Posted by Norman Timmler <no...@neteye.de>.
that's a interesting point. any experieence about orion-server?

-----Original Message-----
From: Ryan Cornia [mailto:rcornia@dced.state.ut.us]
Sent: Tuesday, July 10, 2001 4:49 PM
To: struts-user@jakarta.apache.org
Subject: Error-page in web.xml


I'm hoping someone can help me understand this better. In web.xml, I have
the following entries -
        <error-page>
            <exception-type>java.lang.Exception</exception-type>
            <location>/errorpage.jsp</location>
        </error-page>
       <error-page>
            <exception-type>javax.servlet.ServletException</exception-type>
            <location>/errorpagesrvlt.jsp</location>
        </error-page>

>>From my understanding, anytime an Exception, or ServletException occurs in
my application, it will call either errorpage.jsp or errorpagesrvlt.jsp. Is
that correct? Does it matter if the exception occurs in a JSP or a servlet?

This seems to work in Tomcat, but with SilverStream, I don't get taken to
the error page, but get the SilverStream generate error message.

In my errorpage.jsp I have -

<%@ page language="Java" isErrorPage="true"%>


is that right?

Thanks for any insite, this is driving me crazy.
Ryan