You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Zhiyong Li <Zh...@ibiomatics.com> on 2001/01/05 15:44:53 UTC

[Q] struts:link with forward attribute on WebLogic 6.0

I try to forward the request in a jsp page as follows:

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts.tld" prefix="struts" %>

<HTML>
         <struts:link forward="ibohome"></struts:link>
         
</HTML>
 
I have the "ibohome" defined in the action.xml as follows,

   <!-- Global Forward Declarations -->
  <forward name="ibohome"
path="/generic.do?jsp=/iBiomaticsPortal/MainContents.jsp"/>

However, I got the following exception when I am trying to run it (I got
the same exception if I replace "success" with "ibohome").

Could not deserialize context attribute
java.io.NotSerializableException:
org.apache.struts.action.ActionForwards
        at
java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1148)
        at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
        at
weblogic.servlet.internal.AttributeWrapper.getObject(AttributeWrapper.ja
va:71)
        at
weblogic.servlet.internal.WebAppServletContext.getAttribute(WebAppServle
tContext.java:211
)
        at
weblogic.servlet.jsp.PageContextImpl.getAttribute(PageContextImpl.java:1
64)
        at org.apache.struts.taglib.LinkTag.hyperlink(LinkTag.java:348)
        at org.apache.struts.taglib.LinkTag.doStartTag(LinkTag.java:270)
        at
jsp_servlet._ibiomaticsportal._struts_test_zli._jspService(_struts_test_
zli.java:87)
        at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java:208)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java:244)
        at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServl
etContext.java:11
27)
        at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.
java:1529)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
<Jan 5, 2001 9:21:50 AM EST> <Error> <HTTP>
<[WebAppServletContext(8068452,DefaultWebApp_myserver)]
Root cause of ServletException
javax.servlet.jsp.JspException: Cannot locate forwards mapping table
        at org.apache.struts.taglib.LinkTag.hyperlink(LinkTag.java:351)
        at org.apache.struts.taglib.LinkTag.doStartTag(LinkTag.java:270)
        at
jsp_servlet._ibiomaticsportal._struts_test_zli._jspService(_struts_test_
zli.java:87)
        at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java:208)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java:244)
        at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServl
etContext.java:11
27)
        at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.
java:1529)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


==============================================
What I am trying to do is that when the index.html or index.jsp is
invoked, it will forward the request to my main page without user to
type anything. Any other approach I can take.

Thanks,
Zhiyong Li
Portal Development
iBiomatics LLC ,  a SAS Company
(919) 653-2746
Zhiyong.Li@iBiomatics.com



Re: [Q] struts:link with forward attribute on WebLogic 6.0

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Zhiyong Li wrote:

> I try to forward the request in a jsp page as follows:
>
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts.tld" prefix="struts" %>
>
> <HTML>
>          <struts:link forward="ibohome"></struts:link>
>

Note that you'll probably want some text in between the beginning and ending
tags, so you can actually see the hyperlink on the browser screen.

>
> </HTML>
>
> I have the "ibohome" defined in the action.xml as follows,
>
>    <!-- Global Forward Declarations -->
>   <forward name="ibohome"
> path="/generic.do?jsp=/iBiomaticsPortal/MainContents.jsp"/>
>
> However, I got the following exception when I am trying to run it (I got
> the same exception if I replace "success" with "ibohome").
>
> Could not deserialize context attribute
> java.io.NotSerializableException:
> org.apache.struts.action.ActionForwards
>

WebLogic 6.0 currently has a restriction that all servlet context attributes in
a webapp have to be Serializable (not just session attributes).  I've been going
through the various objects that Struts itself creates, and ActionForwards
(among others) was recently made Serializable -- you should be able to do this
with a very recent nightly build.

NOTE:  The Struts example application still won't work, though -- it uses a
context attribute that is not serializable, so it won't work correctly on this
platform.

Craig McClanahan