You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Gaetano Bigliardi <ga...@tiscali.it> on 2001/12/27 09:33:45 UTC

action classes aren't dinamically loaded (with BroadVision)

 I've a problema using Struts with BroadVision One-To-One Enterprise. The
problem is: I write an action class, after defining it in the file "/WEB-INF/struts-config.xml",
and I execute it. When I make a change in the Java action class  I execute
again it, the result is that the action class is not reloaded!

  I've definded the "/demo" context to be reloadable in the BroadVision
XML configuration file (and this define also that "/demo" is using JSP rather
than server-side JavaScript). Using plain JSP the classes in the directory
"/WEB-INF/classes" are dinamically reloaded when the JSP is recompiled.
Using Struts the actions aren't reloaded dinamically.

  This is my web.xml and struts-config.xml file. A question: what does it
mean "load-on-startup" with value 2?

  Thanks, Gaetano Bigliardi


--- web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">

<web-app>
    <servlet-mapping>
        <servlet-name>
            jspCompiler
        </servlet-name>
        <url-pattern>
            *.jsp
        </url-pattern>
    </servlet-mapping>   
    <servlet>
        <servlet-name>
            jspCompiler
        </servlet-name>
        <servlet-class>
            org.apache.jasper.runtime.JspServlet
        </servlet-class>
        <init-param>
            <param-name>scratchdir</param-name>
            <param-value>/home/jsvil/bv1to1_var/scratchdemo</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
                <param-name>config</param-name>
                <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <init-param>
                <param-name>debug</param-name>
                <param-value>0</param-value>
        </init-param>
        <init-param>
                <param-name>detail</param-name>
                <param-value>0</param-value>
        </init-param>
        <init-param>
                <param-name>validate</param-name>
                <param-value>true</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>
</web-app>


--- struts-config.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd"
>

<!-- Applicazione demo -->

<struts-config>
  <action-mappings>
     <action path="/demoa_login"
             type="demoa_login"
	     scope="session">
       <forward name="success" path="/demo_login.jsp" />
     </action>
     <action path="/test01"
             type="test01"
	     scope="session">
       <forward name="success" path="/test01.jsp" />
     </action>
     <action path="/anagrafica_mvc"
             type="anagrafica_mvc"
	     scope="session">
       <forward name="success" path="/anagrafica_mvc.jsp" />
     </action>
  </action-mappings>
</struts-config>


--- bvsm.xml
<Server>
  <Context urlPrefix="/demo" docRoot="demo" reloadable="true" />
</Server>




__________________________________________________________________
Abbonati a Tiscali!
Con Tiscali By Phone puoi anche ascoltare ed inviare email al telefono.
Chiama Tiscali By Phone all' 892 800        http://byphone.tiscali.it





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: action classes aren't dinamically loaded (with BroadVision)

Posted by Ted Husted <hu...@apache.org>.
It's been my experience that different containers vary in their ability
to sense changes to Action classes and even JavaServer Pages. Resin is
quite good at this. Tomcat on Linux is also good at this. (Though Tomcat
on NT does not seem to be quite as good.) This is really up to the
container, and there isn't much that Struts can do about it. 

The load-on-startup is defined by the servlet specification. 

http://java.sun.com/products/servlet/

It simply indicates in which order the servlet should be loaded. The
"zeros" are loaded first, then the "1"s and then the "2"s and so forth.
It doesn't affect runtime behavior. 

<unsolicited-advice>
If I were using something like BroadVision, I might be tempted to do my
desktop development using another container, like Resin, and then test
the deployment against both Tomcat and Broadvision. This is to ensure
that application remains compliant, and is not relying on any
proprietary "features". Of course, this implies that automated unit
tests are being written and can be run automatically using something
like Cactus, on at least a daily basis.
</unsolicited-advice>


Gaetano Bigliardi wrote:
> 
>  I've a problema using Struts with BroadVision One-To-One Enterprise. The
> problem is: I write an action class, after defining it in the file "/WEB-INF/struts-config.xml",
> and I execute it. When I make a change in the Java action class  I execute
> again it, the result is that the action class is not reloaded!
> 
>   I've definded the "/demo" context to be reloadable in the BroadVision
> XML configuration file (and this define also that "/demo" is using JSP rather
> than server-side JavaScript). Using plain JSP the classes in the directory
> "/WEB-INF/classes" are dinamically reloaded when the JSP is recompiled.
> Using Struts the actions aren't reloaded dinamically.
> 
>   This is my web.xml and struts-config.xml file. A question: what does it
> mean "load-on-startup" with value 2?
> 
>   Thanks, Gaetano Bigliardi
> 
> --- web.xml
> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> <!DOCTYPE web-app
>     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
>     "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
> 
> <web-app>
>     <servlet-mapping>
>         <servlet-name>
>             jspCompiler
>         </servlet-name>
>         <url-pattern>
>             *.jsp
>         </url-pattern>
>     </servlet-mapping>
>     <servlet>
>         <servlet-name>
>             jspCompiler
>         </servlet-name>
>         <servlet-class>
>             org.apache.jasper.runtime.JspServlet
>         </servlet-class>
>         <init-param>
>             <param-name>scratchdir</param-name>
>             <param-value>/home/jsvil/bv1to1_var/scratchdemo</param-value>
>         </init-param>
>     </servlet>
>     <servlet-mapping>
>         <servlet-name>action</servlet-name>
>         <url-pattern>*.do</url-pattern>
>     </servlet-mapping>
>     <servlet>
>         <servlet-name>action</servlet-name>
>         <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
>         <init-param>
>                 <param-name>config</param-name>
>                 <param-value>/WEB-INF/struts-config.xml</param-value>
>         </init-param>
>         <init-param>
>                 <param-name>debug</param-name>
>                 <param-value>0</param-value>
>         </init-param>
>         <init-param>
>                 <param-name>detail</param-name>
>                 <param-value>0</param-value>
>         </init-param>
>         <init-param>
>                 <param-name>validate</param-name>
>                 <param-value>true</param-value>
>         </init-param>
>         <load-on-startup>2</load-on-startup>
>     </servlet>
> </web-app>
> 
> --- struts-config.xml
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> 
> <!DOCTYPE struts-config PUBLIC
>           "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
>           "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd"
> >
> 
> <!-- Applicazione demo -->
> 
> <struts-config>
>   <action-mappings>
>      <action path="/demoa_login"
>              type="demoa_login"
>              scope="session">
>        <forward name="success" path="/demo_login.jsp" />
>      </action>
>      <action path="/test01"
>              type="test01"
>              scope="session">
>        <forward name="success" path="/test01.jsp" />
>      </action>
>      <action path="/anagrafica_mvc"
>              type="anagrafica_mvc"
>              scope="session">
>        <forward name="success" path="/anagrafica_mvc.jsp" />
>      </action>
>   </action-mappings>
> </struts-config>
> 
> --- bvsm.xml
> <Server>
>   <Context urlPrefix="/demo" docRoot="demo" reloadable="true" />
> </Server>
> 
> __________________________________________________________________
> Abbonati a Tiscali!
> Con Tiscali By Phone puoi anche ascoltare ed inviare email al telefono.
> Chiama Tiscali By Phone all' 892 800        http://byphone.tiscali.it
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>