You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ashish Kulkarni <ku...@yahoo.com> on 2004/10/14 23:55:35 UTC

problem with element in struts-config.xml

Hi
I am having problem with <forward .> element
I have 2 jsp, adminlogin.jsp is in folder pages and
index.jsp is in folder pages\admin
Here is how i have defined my action in
struts-config.xml file
<action name="loginForm" type="admin.AdminLoginAction"
validate="true" scope="request"   
path="/pages/admin/adminlogin">
<forward name="success"
path="/pages/admin/index.jsp"/>
<forward name="error" path="/pages/adminlogin.jsp"  />
</action>
Now the problem if i get error in AdminLoginAction it
tries to display adminlogin.jsp, but the relative path
gets messed up and i dont see any images, 
but if i declare it as
<forward name="error" path="/pages/adminlogin.jsp" 
redirect="true"/>
it works fine, but then i dont get error messages set
in action class.
So how do i work make it work
Ashish


		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: problem with element in struts-config.xml

Posted by Ashish Kulkarni <ku...@yahoo.com>.
Hi
Thanx for the reply, <html:base/> does solve all my
issues with forward
Ashish
--- Jeff Beal <jb...@webmedx.com> wrote:

> When redirect is "true" a message is sent to the
> browser to get the new 
> resource.  This means that the browser is aware of
> the path of your 
> error.jsp.  When redirect is false, the browser is
> not aware of the 
> location of the JSP that is actually displaying the
> results.  To get 
> around the problem, the <html:base/> tag will tell
> the browser to 
> resolve all URI's contained in the HTML document
> against a different 
> location.  I'm pretty sure (though I haven't used
> this) that all you 
> need to do is include <html:base/> at the top of
> your error.jsp file to 
> have everything resolve correctly.
> 
> -- Jeff
> 
> Ashish Kulkarni wrote:
> > Hi
> > I am having problem with <forward .> element
> > I have 2 jsp, adminlogin.jsp is in folder pages
> and
> > index.jsp is in folder pages\admin
> > Here is how i have defined my action in
> > struts-config.xml file
> > <action name="loginForm"
> type="admin.AdminLoginAction"
> > validate="true" scope="request"   
> > path="/pages/admin/adminlogin">
> > <forward name="success"
> > path="/pages/admin/index.jsp"/>
> > <forward name="error" path="/pages/adminlogin.jsp"
>  />
> > </action>
> > Now the problem if i get error in AdminLoginAction
> it
> > tries to display adminlogin.jsp, but the relative
> path
> > gets messed up and i dont see any images, 
> > but if i declare it as
> > <forward name="error" path="/pages/adminlogin.jsp"
> 
> > redirect="true"/>
> > it works fine, but then i dont get error messages
> set
> > in action class.
> > So how do i work make it work
> > Ashish
> > 
> > 
> > 		
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail Address AutoComplete - You start. We
> finish.
> > http://promotions.yahoo.com/new_mail 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


=====
A$HI$H


		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: problem with element in struts-config.xml

Posted by Jeff Beal <jb...@webmedx.com>.
When redirect is "true" a message is sent to the browser to get the new 
resource.  This means that the browser is aware of the path of your 
error.jsp.  When redirect is false, the browser is not aware of the 
location of the JSP that is actually displaying the results.  To get 
around the problem, the <html:base/> tag will tell the browser to 
resolve all URI's contained in the HTML document against a different 
location.  I'm pretty sure (though I haven't used this) that all you 
need to do is include <html:base/> at the top of your error.jsp file to 
have everything resolve correctly.

-- Jeff

Ashish Kulkarni wrote:
> Hi
> I am having problem with <forward .> element
> I have 2 jsp, adminlogin.jsp is in folder pages and
> index.jsp is in folder pages\admin
> Here is how i have defined my action in
> struts-config.xml file
> <action name="loginForm" type="admin.AdminLoginAction"
> validate="true" scope="request"   
> path="/pages/admin/adminlogin">
> <forward name="success"
> path="/pages/admin/index.jsp"/>
> <forward name="error" path="/pages/adminlogin.jsp"  />
> </action>
> Now the problem if i get error in AdminLoginAction it
> tries to display adminlogin.jsp, but the relative path
> gets messed up and i dont see any images, 
> but if i declare it as
> <forward name="error" path="/pages/adminlogin.jsp" 
> redirect="true"/>
> it works fine, but then i dont get error messages set
> in action class.
> So how do i work make it work
> Ashish
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail Address AutoComplete - You start. We finish.
> http://promotions.yahoo.com/new_mail 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: problem with element in struts-config.xml

Posted by "David G. Friedman" <hu...@ix.netcom.com>.
Ashish,

Your action has validate="true" but not input="...." parameter to go when
validation fails. So where does the page go?  Is this part of your display
problem?

Regards,
David

-----Original Message-----
From: Ashish Kulkarni [mailto:kulkarni_ash1312@yahoo.com]
Sent: Thursday, October 14, 2004 5:56 PM
To: struts-user@jakarta.apache.org
Subject: problem with <forward..> element in struts-config.xml


Hi
I am having problem with <forward .> element
I have 2 jsp, adminlogin.jsp is in folder pages and
index.jsp is in folder pages\admin
Here is how i have defined my action in
struts-config.xml file
<action name="loginForm" type="admin.AdminLoginAction"
validate="true" scope="request"
path="/pages/admin/adminlogin">
<forward name="success"
path="/pages/admin/index.jsp"/>
<forward name="error" path="/pages/adminlogin.jsp"  />
</action>
Now the problem if i get error in AdminLoginAction it
tries to display adminlogin.jsp, but the relative path
gets messed up and i dont see any images,
but if i declare it as
<forward name="error" path="/pages/adminlogin.jsp"
redirect="true"/>
it works fine, but then i dont get error messages set
in action class.
So how do i work make it work
Ashish



__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org