Setting In Struts

Can any one tell me the setting of path and classpath variables in Struts???

There aren't any.

Similar Messages

  • Setting up a cluster for the first time: newbie questions

    Any help appreciated with this situation:
              I'm trying to set up a cluster for the first time and running into
              issues (no big surprise). I'll outline my situation and pose questions
              as they arise. If/when I get things to work I'll post a step-by-step
              summary of what it took to get a simple cluster going.
              Here's what I have:
              machines:
              1 Windows 2000 machines with WL 6.1
              2 RedHat Linux machines with WL 6.1
              All machines are on the same Home LAN, can see each other, etc.
              IP addresses are:
              Windows box: 192.168.1.100
              Linux box 1: 192.168.1.102
              Linux box 2: 192.168.1.103
              servers:
              I've set up the Windows machine as my admin server, and set up
              a managed server on each Linux machine. I created a cluster that consists
              of the 2 Linux machines and deployed the web app and EJB to the cluster.
              The Windows machine is acting as a Proxy using ClusterServlet.
              The web application has been set as the Default Web Application on the
              two Linux machines. All 3 machines are listening on ports 80/443. I also
              set up session memory replication through the console.
              Application:
              I have an application that I package as an EAR file. I'm using it as a
              "reference" application designed to mimic a real world app as much as possible.
              The EAR file contains a web application that uses Struts. It also consists
              of a single Stateless Session Bean. The WAR file and EJB Jar are all
              packaged up into the EAR file. I've been able to run this application just
              fine on a single managed server on all 3 machines.
              The web application works fine, and it can invoke the EJB. I can also
              invoke the EJB from Java stand-alone clients. Struts works great. All is
              well with the world. Now I'm trying to "cluster-ize" this app using
              the environment described above and encountering issues.
              I've read the docs and followed the instructions according to the
              "Weblogic Bible" book. I can bring up all 3 servers and the Linux
              managed servers connect to the cluster just fine. I can also
              see the Struts messages in their logs which normally happens and tells me
              the webapp is initialized properly. The console tells me that the managed
              servers are running. I get no error messages starting up any of the serves.
              Here are the problems I am encountering.
              When I try to access the Web Application (through a browser on the
              Windows machine using http://localhost) I get the following error message:
              <Nov 19, 2002 6:44:33 AM EST> <Error> <HTTP> <HttpServer(1754841,null default ct
              x,admin) found no context for "/". This request does not match the context path
              for any installed web applications and there is no default web application confi
              gured.>
              Also, when I try to invoke the EJB through a stand-alone Java client,
              I get a JNDI lookup error on the EJB's home interface.
              Questions:
              Question1: I noticed when setting up the machines that console lets you
              define a "Machine" or a "Unix Machine". What's the difference? Should I
              define the Linux machines as Unix machines or machines, and what are the
              consequences of either choice?
              Question2:
              I'm not totally clear on how my web.xml should look to set up Struts,
              the ClusterServlet, and a servlet filter I'm using to test Servlet filters.
              Here is what I had before I tried to cluster and which works fine:
              <filter>
              <filter-name>MainFilter</filter-name>
              <filter-class>com.refapp.servlets.MainFilter</filter-class>
              <init-param>
              <param-name>myAttribute</param-name>
              <param-value>Foo</param-value>
              </init-param>
              </filter>
              <filter-mapping>
              <filter-name>MainFilter</filter-name>
              <url-pattern>/*</url-pattern>
              </filter-mapping
              <!-- Struts ActionServlet Configuration -->
              <servlet>
              <servlet-name>action</servlet-name>
              <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
              <init-param>
              <param-name>application</param-name>
              <param-value>refappstruts</param-value>
              </init-param>
              <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>2</param-value>
              </init-param>
              <init-param>
              <param-name>mapping</param-name>
              <param-value>org.apache.struts.action.RequestActionMapping</param-value>
              </init-param>
              <load-on-startup>2</load-on-startup>
              </servlet>
              <servlet-mapping>
              <servlet-name>action</servlet-name>
              <url-pattern>*.do</url-pattern>
              </servlet-mapping>
              <welcome-file-list>
              <welcome-file>index.do</welcome-file>
              <welcome-file>index.jsp</welcome-file>
              <welcome-file>index.html</welcome-file>
              </welcome-file-list>
              (I have set up a "dummy" 0-length file called index.do that triggers
              Struts to go into its ActionServlet when first accessing the web site).
              Here is how I added ClusterServlet to web.xml:
              servlet>
              <servlet-name>ClusterServlet</servlet-name>
              <servlet-class>weblogic.servlet.internal.HttpClusterServlet</servlet-class>
              <load-on-startup>0</load-on-startup>
              <init-param>
              <param-name>defaultServers</param-name>
              <param-value>192.168.1.102:80:443|192.168.1.103:80:443</param-value>
              </init-param>
              <init-param>
              <param-name>DebugConfigInfo</param-name>
              <param-value>ON</param-value>
              </init-param>
              </servlet>
              <servlet-mapping>
              <servlet-name>InitServlet</servlet-name>
              <url-pattern>/servlet/InitServlet</url-pattern>
              </servlet-mapping>
              <servlet-mapping>
              <servlet-name>action</servlet-name>
              <url-pattern>*.do</url-pattern>
              </servlet-mapping>
              <servlet-mapping>
              <servlet-name>ClusterServlet</servlet-name>
              <url-pattern>/</url-pattern>
              </servlet-mapping>
              <servlet-mapping>
              <servlet-name>ClusterServlet</servlet-name>
              <url-pattern>*.html</url-pattern>
              </servlet-mapping>
              <servlet-mapping>
              <servlet-name>ClusterServlet</servlet-name>
              <url-pattern>*.jsp</url-pattern>
              </servlet-mapping>
              <servlet-mapping>
              <servlet-name>ClusterServlet</servlet-name>
              <url-pattern>*.do</url-pattern>
              </servlet-mapping>
              Clearly there is a problem with the Default Web application not being
              seen/mapped properly. Any chances my URL mappings for the filter servlet,
              Struts, and ClusterServlet are stepping on each other?
              With respect to the EJB, here is what my weblogic-ejb-jar looks like:
              <weblogic-ejb-jar>
              <weblogic-enterprise-bean>
              <ejb-name>Hello</ejb-name>
              <stateless-session-descriptor>
              <pool>
                   <max-beans-in-free-pool>100</max-beans-in-free-pool>
              </pool>
              <stateless-clustering>
              <stateless-bean-is-clusterable>true</stateless-bean-is-clusterable>
              <stateless-bean-load-algorithm>
              round-robin
              </stateless-bean-load-algorithm>
              <stateless-bean-methods-are-idempotent>
              true
              </stateless-bean-methods-are-idempotent>
              </stateless-clustering>
              </stateless-session-descriptor>
              <jndi-name>Hello.Home</jndi-name>
              </weblogic-enterprise-bean>
              I run this through ejbc and package everything up into the EAR file.
              However, I get a JNDI lookup failure when I try to access the Bean from
              a standalone Java client running on the Windows machine.
              Here is the jndi.properties file that I am using:
              java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
              java.naming.provider.url=t3://localhost:80
              Any ideas what I'm doing wrong here? I can post config.xml also if needed.
              Thanks in advance!
              

    Let me try to answer :)....
              A1> No need to name diff machines by default weblogic
              considers the servers are physically located in diff boxes.
              The names are used to differtiate the mang servers which are in
              multihomed
              Some things to chk
              1> Did u targeted the ear file Target as cluster.
              2> Can u see on the Admin console that both the man servers
              are participated in the cluster( u can see by clicking the monitoring
              tab on the Cluster node).
              3>Is the URL:PORT for the default web app correct?
              the reason: is I dont see the port# on the link u mentioned
              4> probably ur ejb might not been deployed on the target thats the
              reason u cant access thru java client. If u correct the targets that
              will probably fix it.
              Hope this helps
              Please post the result
              Thanks
              Sudhir
              [email protected] (Chris) wrote in message news:<[email protected]>...
              > Any help appreciated with this situation:
              > I'm trying to set up a cluster for the first time and running into
              > issues (no big surprise). I'll outline my situation and pose questions
              > as they arise. If/when I get things to work I'll post a step-by-step
              > summary of what it took to get a simple cluster going.
              > Here's what I have:
              >
              > machines:
              > 1 Windows 2000 machines with WL 6.1
              > 2 RedHat Linux machines with WL 6.1
              > All machines are on the same Home LAN, can see each other, etc.
              > IP addresses are:
              > Windows box: 192.168.1.100
              > Linux box 1: 192.168.1.102
              > Linux box 2: 192.168.1.103
              >
              > servers:
              > I've set up the Windows machine as my admin server, and set up
              > a managed server on each Linux machine. I created a cluster that consists
              > of the 2 Linux machines and deployed the web app and EJB to the cluster.
              > The Windows machine is acting as a Proxy using ClusterServlet.
              > The web application has been set as the Default Web Application on the
              > two Linux machines. All 3 machines are listening on ports 80/443. I also
              > set up session memory replication through the console.
              >
              > Application:
              > I have an application that I package as an EAR file. I'm using it as a
              > "reference" application designed to mimic a real world app as much as possible.
              > The EAR file contains a web application that uses Struts. It also consists
              > of a single Stateless Session Bean. The WAR file and EJB Jar are all
              > packaged up into the EAR file. I've been able to run this application just
              > fine on a single managed server on all 3 machines.
              > The web application works fine, and it can invoke the EJB. I can also
              > invoke the EJB from Java stand-alone clients. Struts works great. All is
              > well with the world. Now I'm trying to "cluster-ize" this app using
              > the environment described above and encountering issues.
              >
              > I've read the docs and followed the instructions according to the
              > "Weblogic Bible" book. I can bring up all 3 servers and the Linux
              > managed servers connect to the cluster just fine. I can also
              > see the Struts messages in their logs which normally happens and tells me
              > the webapp is initialized properly. The console tells me that the managed
              > servers are running. I get no error messages starting up any of the serves.
              >
              > Here are the problems I am encountering.
              >
              > When I try to access the Web Application (through a browser on the
              > Windows machine using http://localhost) I get the following error message:
              >
              > <Nov 19, 2002 6:44:33 AM EST> <Error> <HTTP> <HttpServer(1754841,null default ct
              > x,admin) found no context for "/". This request does not match the context path
              > for any installed web applications and there is no default web application confi
              > gured.>
              >
              > Also, when I try to invoke the EJB through a stand-alone Java client,
              > I get a JNDI lookup error on the EJB's home interface.
              >
              > Questions:
              > Question1: I noticed when setting up the machines that console lets you
              > define a "Machine" or a "Unix Machine". What's the difference? Should I
              > define the Linux machines as Unix machines or machines, and what are the
              > consequences of either choice?
              >
              > Question2:
              > I'm not totally clear on how my web.xml should look to set up Struts,
              > the ClusterServlet, and a servlet filter I'm using to test Servlet filters.
              > Here is what I had before I tried to cluster and which works fine:
              >
              > <filter>
              > <filter-name>MainFilter</filter-name>
              > <filter-class>com.refapp.servlets.MainFilter</filter-class>
              > <init-param>
              > <param-name>myAttribute</param-name>
              > <param-value>Foo</param-value>
              > </init-param>
              > </filter>
              >
              > <filter-mapping>
              > <filter-name>MainFilter</filter-name>
              > <url-pattern>/*</url-pattern>
              > </filter-mapping
              >
              >
              > <!-- Struts ActionServlet Configuration -->
              > <servlet>
              > <servlet-name>action</servlet-name>
              > <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
              >
              > <init-param>
              > <param-name>application</param-name>
              > <param-value>refappstruts</param-value>
              > </init-param>
              >
              > <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>2</param-value>
              > </init-param>
              >
              > <init-param>
              > <param-name>mapping</param-name>
              > <param-value>org.apache.struts.action.RequestActionMapping</param-value>
              > </init-param>
              > <load-on-startup>2</load-on-startup>
              > </servlet>
              >
              > <servlet-mapping>
              > <servlet-name>action</servlet-name>
              > <url-pattern>*.do</url-pattern>
              > </servlet-mapping>
              >
              > <welcome-file-list>
              > <welcome-file>index.do</welcome-file>
              > <welcome-file>index.jsp</welcome-file>
              > <welcome-file>index.html</welcome-file>
              > </welcome-file-list>
              >
              > (I have set up a "dummy" 0-length file called index.do that triggers
              > Struts to go into its ActionServlet when first accessing the web site).
              >
              > Here is how I added ClusterServlet to web.xml:
              >
              > servlet>
              > <servlet-name>ClusterServlet</servlet-name>
              > <servlet-class>weblogic.servlet.internal.HttpClusterServlet</servlet-class>
              > <load-on-startup>0</load-on-startup>
              > <init-param>
              > <param-name>defaultServers</param-name>
              > <param-value>192.168.1.102:80:443|192.168.1.103:80:443</param-value>
              > </init-param>
              > <init-param>
              > <param-name>DebugConfigInfo</param-name>
              > <param-value>ON</param-value>
              > </init-param>
              > </servlet>
              >
              > <servlet-mapping>
              > <servlet-name>InitServlet</servlet-name>
              > <url-pattern>/servlet/InitServlet</url-pattern>
              > </servlet-mapping>
              >
              > <servlet-mapping>
              > <servlet-name>action</servlet-name>
              > <url-pattern>*.do</url-pattern>
              > </servlet-mapping>
              >
              > <servlet-mapping>
              > <servlet-name>ClusterServlet</servlet-name>
              > <url-pattern>/</url-pattern>
              > </servlet-mapping>
              >
              > <servlet-mapping>
              > <servlet-name>ClusterServlet</servlet-name>
              > <url-pattern>*.html</url-pattern>
              > </servlet-mapping>
              >
              > <servlet-mapping>
              > <servlet-name>ClusterServlet</servlet-name>
              > <url-pattern>*.jsp</url-pattern>
              > </servlet-mapping>
              >
              > <servlet-mapping>
              > <servlet-name>ClusterServlet</servlet-name>
              > <url-pattern>*.do</url-pattern>
              > </servlet-mapping>
              >
              >
              > Clearly there is a problem with the Default Web application not being
              > seen/mapped properly. Any chances my URL mappings for the filter servlet,
              > Struts, and ClusterServlet are stepping on each other?
              >
              > With respect to the EJB, here is what my weblogic-ejb-jar looks like:
              >
              > <weblogic-ejb-jar>
              > <weblogic-enterprise-bean>
              > <ejb-name>Hello</ejb-name>
              > <stateless-session-descriptor>
              > <pool>
              >      <max-beans-in-free-pool>100</max-beans-in-free-pool>
              > </pool>
              > <stateless-clustering>
              > <stateless-bean-is-clusterable>true</stateless-bean-is-clusterable>
              > <stateless-bean-load-algorithm>
              > round-robin
              > </stateless-bean-load-algorithm>
              > <stateless-bean-methods-are-idempotent>
              > true
              > </stateless-bean-methods-are-idempotent>
              > </stateless-clustering>
              > </stateless-session-descriptor>
              > <jndi-name>Hello.Home</jndi-name>
              > </weblogic-enterprise-bean>
              >
              > I run this through ejbc and package everything up into the EAR file.
              > However, I get a JNDI lookup failure when I try to access the Bean from
              > a standalone Java client running on the Windows machine.
              > Here is the jndi.properties file that I am using:
              >
              > java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
              > java.naming.provider.url=t3://localhost:80
              >
              > Any ideas what I'm doing wrong here? I can post config.xml also if needed.
              >
              > Thanks in advance!
              

  • How to get the variable set by c:set in Scriptlet ?

    Hello,
    I set up some variables by <c:set> and struts tag <bean:size>, and the values should be considered as integers. How can I use the variables in math expression?
    When I try to use the variables in scriptlets, I got compile errors in the getAttribute lines.
    My code:
    <bean:size id="listSize" name="list" /> <c:set var="pageSize" value="${20}" />
    <c:set var="pageBegin" value="${param.pageBegin}" />
    <%
    int ls = (Integer)pageContext.getAttribute("listSize");
    int ps = (Integer)pageContext.getAttribute("pageSize");
    int totalPages = (int)Math.ceil((double)ls / ps);
    %>

    xiaoxuan_li wrote:Hello,
    I set up some variables by <c:set> and struts tag <bean:size>, and the values should be considered as integers. How can I use the variables in math expression?
    When I try to use the variables in scriptlets, I got compile errors in the getAttribute lines.
    My code:
    <bean:size id="listSize" name="list" />
    <c:set var="pageSize" value="${20}" />
    <c:set var="pageBegin" value="${param.pageBegin}" />
    <%
    bq. int ls = (Integer)pageContext.getAttribute("listSize"); \\ int ps = (Integer)pageContext.getAttribute("pageSize"); \\ int totalPages = (int)Math.ceil((double)ls / ps);
    %>I finally find the errors, I change the getAttribute() lines to the following, and the program runs well, although I'm still curious of if there is a better way to get the value of totalPages by using JSTL tags, instead of scriptlets.
    <%
    bq. {color:#ff0000}Number {color}ls = {color:#ff0000}(Number){color}pageContext.getAttribute("listSize"); \\ {color:#ff0000}Number {color}ps = {color:#ff0000}(Number){color}pageContext.getAttribute("pageSize");
    %>

  • How to reach Struts variables in a JSP scriptlet?

    hello!
    First I would like to clarify, I know writing scriptlet code (eg database connect) in a JSP page is basicly wrong, but I have to make a project that way, because my Java teacher asked so.
    My problem is the following: I have a struts-config.xml:
    <?xml version="1.0" encoding="windows-1250" ?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
      <form-beans>
        <form-bean name="form-bean0" type="neptun.UserFormBean"/>
      </form-beans>
      <action-mappings>
        <action path="/loginAction" input="/login.jsp" type="neptun.LoginAction"
                name="form-bean0">
          <forward name="success" path="/loggedIn.jsp"/>
        </action>
      </action-mappings>
      <message-resources parameter="neptun.ApplicationResources"/>
    </struts-config>It creates a form-bean0 object, using my UserFormBean class.
    This class has two variables: login and password. Of course it has the accessors
    When the user tries to log in, the variables are set through struts-html tags:
    <html:text property="login" size="6"/>After the neccessary action called, and the user could be verified, it forwards to a page called loggedIn.jsp
    Now my problem is that I would like to reach the login variable, containing the username of the user. When I insert ${param.login} to the jsp code, it works. But I would like to have a variable in my scriptlet code, which contains the user name. param object are not accessible, and session object contains only a reference to form-bean0. I think I dont have to write use-bean tag, because struts framework automatically does this.
    Thank you for your help!
    Balazs

    I may have used the term incorrectly. Basically I meant using the <jsp:include> tag to invoke a servlet directly. Then the servlet could send the output you need. That way you could keep things more modular.
    So for example -- you say you have a servlet with these values. Maybe you could add some functionality to it so if it's invoked with a particular URL, it produces output displaying these values.
    Then you could use <jsp:include> to invoke that new functionality via that URL.
    Just an idea.

  • Struts 2 portlet

    Hi,
    I deploy struts 2 portlet to tomcat and get errors as below:
    Error: URI = "jndi:/localhost/example/WEB-INF/skillportTags/xssString.tld", Line = "2", : Document root element "taglib", must match DOCTYPE root "null".
    Error: URI = "jndi:/localhost/example/WEB-INF/skillportTags/xssString.tld", Line = "2", : Document is invalid: no grammar found.
    Maybe I've some config but I don't know what is it, I would to write here for someone could help.
    Thanks,
    suu

    Thank you, for fast reply
    and here is another errors
    14:12:34 ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'struts.portlet.eventAction' on 'class org.apache.struts2.portlet.dispatcher.DirectRenderFromEventAction: Error setting expression 'struts.portlet.eventAction' with value '[Ljava.lang.String;@855379'
    I also search more on google but not found any result yet.
    Thanks,
    suu

  • How to Enable Log4j in Struts

    Hi,
    I have a struts application and I need to implement a logger for it. I would like to use Log4j but am having problems initializing it.
    Because I am using struts, I do no have access to the Action servlet and so cannot place the intiializing code in the servlets init() method.
    Is there a way of using the struts-confix.xml file to enable Log4j logging ?
    Basically I need the application to load up the log4j.properties file using
    PropertyConfiguratior.configure("log4j.properties");
    But how do I do this in Struts ??
    thanks
    Paul

    Struts core library uses commons logging , some drop log4j.properties files /WEB-INFO/classes, cooomons lgging will pick up and initialize.
    Other way is write a plug-in and load the log4j configuration
    ==============================================
    1. Add plug in to struts-config files like validator plug in
    <plug-in className="com.tests.utl.Log4jPlugin">
    <set-property
    property="log4jconfig"
    value="/WEB-INF/log4j.xml"/>
    </plug-in>
    2. Drop log4j.xml file in "/WEB-INFO" folder
    3. Sample "log4j" plug in java class, here key is define property "log4jconfig" as plugin setter/getter, struts will set the value read from struts-config.
    ================================
    public class Log4jPlugin implements PlugIn {
    private String log4jconfig;
    public Log4jPlugin() {
    public void destroy() {
    System.out.println("Destroying Hello World PlugIn");
    public void init(ActionServlet servlet, ModuleConfig config)
    throws ServletException {
    URL url =null;
    try {
    url = servlet.getServletContext().getResource(log4jconffile);
    System.out.println(" url " + url);
    } catch (MalformedURLException ex) {
    ex.printStackTrace();
    DOMConfigurator.configure(url);
    public String getLog4jconfig() {
    return log4jconfig;
    public void setLog4jconfig(String log4jconfig) {
    this.log4jconfig = log4jconfig;
    }

  • RowIterator

    Hi,
    I am trying to iterate through the rows in a detail entity to determine what the maximum number is in a field. The number in each row represents its position in the detail set. When I get the max I will return it to the create(Attributes) method of the detail entity and bump it by one to set its position value when the new record for the entity is created via the insert button in the navigation bar.
    I defined a non-persistent field in the master entity and am using its get function to do the iteration. In my test case I have 3 existing records and the new empty record created by pressing the insert button. When I try to iterate through the detail records, on the second time through the loop the next() returns a null the second time through the loop.
    Here is the code. I have left some debugging statements in so I know what values are.
    public Number getComorbidsmaxrow() {
    // return (Number)getAttributeInternal(COMORBIDSMAXROW);
    /* Get an iterator over the number of comorbid records */
    RowIterator comorbids = this.getComorbids();
    int rowSlot = comorbids.getCurrentRowSlot(); // rowSlot is equal to 2
    int numRows = comorbids.getRowCount(); // numRows is equal to 4
    comorbids.reset();
    /* diagnosis refers to each item within Comorbids */
    ComorbidsImpl diagnosis;
    /* maxRow is the maximum row number found in the Comorbids set */
    Number maxrow = new Number(0);
    /* rowNum is the number of the current diagnosis */
    Number rowNum;
    try {
    // Get the next diagnosis, if comorbids.hasNext() is false then we have reached
    // the end of the iterator
    while (comorbids.hasNext()){
    diagnosis = (ComorbidsImpl) comorbids.next();
    rowNum = diagnosis.getComorbidno(); //first time through, rowNum is equal to null, I believe because the first record is the one being inserted; second time program jumps to the catch after attempting the next() in the previous statement.
    int rowIndex = comorbids.getCurrentRowIndex();
    if (rowNum != null) {
    if (maxrow.intValue() < rowNum.intValue()) maxrow = rowNum;
    catch (Exception ex) {
    return maxrow;
    return maxrow;
    I used the Order/lineItem (traversing entity objects) and the calcDeptTotal (subscribing to an event) examples as models.
    Thanks for any help.
    Peter

    Not entirely sure what you mean...but this might helpful.
    This is meant for a "Data Action" on your struts diagram...you can do a lot there. It's a starting point...there are better ways to handle some of it.
    protected void findForward(DataActionContext actionContext)
    throws IOException, ServletException {
    //This is a view object...javadoc it. You can create/edit, set where clauses, delete etc..
    //Remember to call vo.executeQuery(); after you're done...
    ViewObject vo = actionContext.getBindingContainer().getApplicationModule().findViewObject("SearchClassesView1");
    //This is the request...you can pull parameters from the GET/POST for instance...to set where clauses or what have you.
    HttpServletRequest request = actionContext.getHttpServletRequest();
    String categories = request.getParameter("categories");
    //This is the session...you can set and read attributes from their current session, among other things.
    HttpSession session2 = actionContext.getHttpServletRequest().getSession();
    //This sets which struts "forward" to follow at the end of the data action.
    String target = "success";
    actionContext.setActionForward(target);

  • Problem with strus-config.xml

    i have created the small application in struts which is not hgetting the valures \
    from struts -config.xml
    my folder structure is like this
    struts-example
    WEB-INF
    classes
    sample
    actionform
    action class
    lib
    all lib files
    web.xml
    struts-config.xml
    index.jsp
    if i am trying to access the jsp file it is throwing an error
    i copied all lib files to lib folder
    and i set the struts.jar and servlet.jar to classparth
    please help what else i need to configure for running struts

    Did you add following to web.xml ?
    <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,/WEB-INF/struts-config-2.xml</param-value>
            </init-param>
            <init-param>
                <param-name>application</param-name>
                <param-value>application</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
        </servlet>
    <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
      </servlet-mapping>

  • JSTL Displaying incorrect Locale

    I'm seeing a very strange problem. Here's what I know. I am using Struts 1.2.9 & JSTL. I have a Filter that filters all requests and sets the Struts and JSTL Locale session variables using this pseudocode:
    If there is a "locale" request parameter, create a new Locale with that value and use that, otherwise
    If there is a Locale in the Globals.LOCALE_KEY Session attribute use that, otherwise
    Get the Locale using the request.getLocale() and use that
    If a Locale was found, set the Globals.LOCALE_KEY Session attribute and call Config.set(ses,Config.FMT_LOCALE,locale);
    I have a bunch of debug logging in there and everything appears to be working correctly.
    I have also created a Custom Tag that dumps a bunch of "useful" information to the logs including both of the Session attributes above. They are now showing up as:
    [15:41:54.118] LogConfigSettingsTag.doStartTag: JSTL Configuration Settings
    [15:41:54.118] LogConfigSettingsTag.doStartTag: * javax.servlet.jsp.jstl.fmt.locale: en_US
    [15:41:54.118] LogConfigSettingsTag.doStartTag: * javax.servlet.jsp.jstl.fmt.localizationContext:
    [15:41:54.134] LogConfigSettingsTag.doStartTag: Struts Configuration Settings
    [15:41:54.134] LogConfigSettingsTag.doStartTag: * org.apache.struts.action.LOCALE: en_US (3)
    [15:41:54.134] LogConfigSettingsTag.doStartTag: Session Attributes
    [15:41:54.134] LogConfigSettingsTag.doStartTag: * org.apache.struts.action.LOCALE: en_US
    [15:41:54.134] LogConfigSettingsTag.doStartTag: * javax.servlet.jsp.jstl.fmt.locale: en_US
    So everything looks correct, but if my Accept-Language header is en-us,en;q=0.8,fr-ca;q=0.5,fr;q=0.3 the JSTL fmt:message tag chooses the French resources over the English. If the Accept-Language header is en-us,en;q=0.5 the JSTL fmt:message tag correctly uses the English resources. And no matter which Accept-Language header is sent, Struts bean:message uses the right resources.
    If anyone has any idea what could be causing JSTL to use the wrong resource file, I'd really appreciate a pointer. I've been banging my head on this one for days.
    (*Chris*)

    And for those interested, here is the JSP, and support files that I threw together to test this functionality.
    Properties files for the WEB-INF/classes directory:
    testResources.properties
    line1 = Are you sleeping,
    line2 = Brother John?
    line3 = Morning bells are ringing,
    line4 = Ding ding dong!testResources_fr.properties
    line1 = Fr�re Jacques,
    line2 = Dormez vous?
    line3 = Sonnez les matines,
    line4 = Din, din, don!in struts-config.xml added the mapping for this bundle:
    <message-resources key="rhyme" parameter="testResources" />And the page resourceTest.jsp:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <%@ page import="java.util.Locale"%>
    <%@ page import="org.apache.struts.Globals"%>
    <%@ page import="javax.servlet.jsp.jstl.core.Config"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
    <%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Test Page</title>
    </head>
    <body>
    <h1>Test page</h1>
    <h2> Server Info </h2>
    Server info = <%= application.getServerInfo() %> <br>
    Servlet engine version = <%=  application.getMajorVersion() %>.<%= application.getMinorVersion() %><br>
    Java version = <%= System.getProperty("java.vm.version") %><br>
    Java home = <%= System.getProperty("java.home") %><br>
    Session id = <%= session.getId() %><br>
    <hr>
    <%
         String invalidate = request.getParameter("invalidateSession");
         if (invalidate != null) {
              session.invalidate();
              response.sendRedirect("resourcetest.jsp");
              return;
         String localeString = request.getParameter("localeString");
         if (localeString != null) {
              Locale locale = new Locale(localeString);
              session.setAttribute(Globals.LOCALE_KEY, locale);
              Config.set(session, Config.FMT_LOCALE, locale);
    %>
    <form><select name="localeString">
         <option value="en">English
         <option value="fr">French
    </select> <input type="submit"> <input type="submit"
         name="invalidateSession" value="Invalidate Session"></form>
    <hr>
    <fmt:setBundle basename="testResources" scope="session" />
    <table cellpadding="5" cellspacing="5">
         <tr>
              <td>
              <h2>JSTL Messages</h2>
              <fmt:message key="line1" /><br>
              <fmt:message key="line1" /><br>
              <fmt:message key="line2" /><br>
              <fmt:message key="line2" /><br>
              <fmt:message key="line3" /><br>
              <fmt:message key="line3" /><br>
              <fmt:message key="line4" /><br>
              <fmt:message key="line4" /><br>
              </td>
              <td>
              <h2>Struts messages</h2>
              <bean:message bundle="rhyme" key="line1" /><br>
              <bean:message bundle="rhyme" key="line1" /><br>
              <bean:message bundle="rhyme" key="line2" /><br>
              <bean:message bundle="rhyme" key="line2" /><br>
              <bean:message bundle="rhyme" key="line3" /><br>
              <bean:message bundle="rhyme" key="line3" /><br>
              <bean:message bundle="rhyme" key="line4" /><br>
              <bean:message bundle="rhyme" key="line4" /><br>
              </td>
         </tr>
    </table>
    <hr>
    <h3>Preferred locales</h3>
    <table border="1">
         <c:forEach var="attr" items="${pageContext.request.locales}">
              <tr>
                   <td><c:out value="${attr}" /></td>
              </tr>
         </c:forEach>
    </table>
    <hr>
    <h3>Request Headers</h3>
    <table border="1">
         <c:forEach var="h" items="${header}">
              <tr>
                   <td><c:out value="${h.key}" /></td>
                   <td><c:out value="${h.value}" /></td>
              </tr>
         </c:forEach>
    </table>You will need to add French as a potential language.
    In IE I did this under Tools: Internet Options.
    Click the "Languages..." button near the bottom, and added French.
    The dropdown box chooses between English/French.
    The button invalidates the session, at which point the JSTL version shows French, whereas Struts shows English.
    Adding a specific resourcebundle for English (rather than using the default one) resolves this issue
    Cheers,
    evnafets

  • Reading/writing UTF-8 Characters

    Hi,
    We're having a problem with storing and displaying UTF-8 Chars in Oracle.
    The configuration is at the end of this post.
    A value such as 'et køretøj Test' written to the db does not get rendered
    properly and comes back with garbage chars. If we go to sqlplus and convert
    the same to UTF-8 manually by updating it to
    select convert('et køretøj Test', 'UTF8', 'WE8ISO8859P1') from dual
    then everything gets rendered fine on the front-end. These tests are being
    done on WinXP (Win2000 as well), and the app runs under both Unix and Win2k
    environments.
    Are we missing some config settings?
    Thanks
    -- Dev
    Config
    DriverName Weblogic, Inc. Java-OCI JDBC Driver (weblogicoci37)
    DriverVersion 6.0 Service Pack 2 05/24/2001 11:55:44 #117037
    StartWebLogic.cmd has
    set NLS_LANG=AMERICAN_AMERICA.UTF8
    WL Console -> JDBC Connection Pool setting
    weblogic.codeset=UTF8
    weblogic.oci.codeset_width=0
    weblogic.oci.ncodeset=UTF8
    ( We've tried this with and without these values)
    Running (from JSP)
    ResultSet rs = statement.executeQuery
    ( "select * from nls_database_parameters" );
    the output is
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET UTF8
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZH:TZM
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZH:TZM
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_NCHAR_CHARACTERSET UTF8
    NLS_RDBMS_VERSION 8.1.7.0.0
    Jsp setting (using Struts as well)
    <%@ page language="java" contentType="text/html ; charset=UTF-8"%>
    Web.xml
    <context-param>
    <param-name>weblogic.httpd.inputCharset./*</param-name>
    <param-value>UTF-8</param-value>
    </context-param>

    hello,
    I had trouble with Spanish charcters and seem to have been able to fix it. My posting
    here is based on that experience.
    1.
    Keeping that NLS_LANG in weblogic start script does not seem to do anything.
    2. For weblogic to treat charcters according to a charset you need to specify some
    params in weblogic.xml. Otherwise your form data may end up being interpreted in
    correctly.
    3. When you send data to database you need to make sure any bytes go in with correct
    codeset.
    Vyas
    "Dev Ashish" <[email protected]> wrote:
    Hi,
    We're having a problem with storing and displaying UTF-8 Chars in Oracle.
    The configuration is at the end of this post.
    A value such as 'et køretøj Test' written to the db does not get rendered
    properly and comes back with garbage chars. If we go to sqlplus and convert
    the same to UTF-8 manually by updating it to
    select convert('et køretøj Test', 'UTF8', 'WE8ISO8859P1') from dual
    then everything gets rendered fine on the front-end. These tests are being
    done on WinXP (Win2000 as well), and the app runs under both Unix and Win2k
    environments.
    Are we missing some config settings?
    Thanks
    -- Dev
    Config
    DriverName Weblogic, Inc. Java-OCI JDBC Driver (weblogicoci37)
    DriverVersion 6.0 Service Pack 2 05/24/2001 11:55:44 #117037
    StartWebLogic.cmd has
    set NLS_LANG=AMERICAN_AMERICA.UTF8
    WL Console -> JDBC Connection Pool setting
    weblogic.codeset=UTF8
    weblogic.oci.codeset_width=0
    weblogic.oci.ncodeset=UTF8
    ( We've tried this with and without these values)
    Running (from JSP)
    ResultSet rs = statement.executeQuery
    ( "select * from nls_database_parameters" );
    the output is
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET UTF8
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZH:TZM
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZH:TZM
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_NCHAR_CHARACTERSET UTF8
    NLS_RDBMS_VERSION 8.1.7.0.0
    Jsp setting (using Struts as well)
    <%@ page language="java" contentType="text/html ; charset=UTF-8"%>
    Web.xml
    <context-param>
    <param-name>weblogic.httpd.inputCharset./*</param-name>
    <param-value>UTF-8</param-value>
    </context-param>

  • How to set default value for html:file in struts

    hi
                   i am working on an application using struts situation is i am using the
    <html:file property="" /> to allow the user to upload file. but i need that a default file should be set so that even if the user donot click browse ie                the user wish to upload that default file the default file get uploaded on page submition.     Is it possible to set any default value for html:file ...if yes plz provide any suggestion or links how to achieve this.     thanks in advance

    www.google.com?q=STRUTS+DOCUMENTATION

  • Setting ViewObject Stored Procedure Where Clause Param from Struts Action

    I adapted/used Steve's example to get stored procedure to populate my ViewObject. However, I could not retrieve any rows after passing whereClause value from Struts action. The param in execureQueryForCollection returns null.
    What could be wrong. Thanks.
    Here's my code.
    ViewObjectImpl:
    package org.adb.sls.model;
    import java.math.BigDecimal;
    import java.sql.CallableStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Timestamp;
    import java.sql.Types;
    import oracle.jbo.JboException;
    import oracle.jbo.domain.Date;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.DBTransaction;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OracleTypes;
    // --- File generated by Oracle ADF Business Components Design Time.
    // --- Custom code may be added to this class.
    public class ViewApplicableLoanTypesImpl extends ViewObjectImpl
    * PLSQL block that will execute the REF_CURSOR
    private static final String SQL =
    "begin ? := sls_loan_types_pkg.get_applcbl_staff_lns_fn(?); end;";
    * PLSQL block that will count the REF_CURSOR returned rows
    private static final String COUNTSQL =
    "begin ? := sls_loan_types_pkg.get_count_applcbl_staff_lns_fn(?); end;";
    * This is the default constructor (do not remove)
    public ViewApplicableLoanTypesImpl()
    * Overridden framework method.
    * Wipe out all traces of a built-in query for this VO
    protected void create() {
    getViewDef().setQuery(null);
    getViewDef().setSelectClause(null);
    setQuery(null);
    * Overidden framework method
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams)
    // input parameter is employee number
    String employeeNumber = null;
    if (params != null) {
    employeeNumber = (String) params[0];
    } else
    System.out.println("param is null");
    storeNewResultSet(qc,retrieveRefCursor(qc,employeeNumber));
    super.executeQueryForCollection(qc, params, noUserParams);
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet rs)
    * We ignore the JDBC ResultSet passed by the framework (null anyway) and
    * use the resultset that we've stored in the query-collection-private
    * user data storage
    rs = getResultSet(qc);
    * Create a new row to populate
    ViewRowImpl r = createNewRowForCollection(qc);
    try {
    * Populate new row by attribute slot number for current row in Result Set
    populateAttributeForRow(r,0, nullOrNewNumber(rs.getBigDecimal(1)));
    populateAttributeForRow(r,1, nullOrNewNumber(rs.getBigDecimal(2)));
    populateAttributeForRow(r,2, rs.getString(3));
    populateAttributeForRow(r,3, nullOrNewNumber(rs.getBigDecimal(4)));
    populateAttributeForRow(r,4, rs.getString(5));
    catch (SQLException s) {
    throw new JboException(s);
    return r;
    protected boolean hasNextForCollection(Object qc)
    ResultSet rs = getResultSet(qc);
    boolean nextOne = false;
    try {
    nextOne = rs.next();
    * When were at the end of the result set, mark the query collection
    * as "FetchComplete".
    if (!nextOne) {
    setFetchCompleteForCollection(qc, true);
    * Close the result set, we're done with it
    rs.close();
    catch (SQLException s) {
    throw new JboException(s);
    return nextOne;
    protected void releaseUserDataForCollection(Object qc, Object rs)
    * Ignore the ResultSet passed in since we've created our own.
    * Fetch the ResultSet from the User-Data context instead
    ResultSet userDataRS = getResultSet(qc);
    if (userDataRS != null) {
    try {
    userDataRS.close();
    catch (SQLException s) {
    /* Ignore */
    super.releaseUserDataForCollection(qc, rs);
    public long getQueryHitCount(ViewRowSetImpl viewRowSet)
    Object[] params = viewRowSet.getParameters(true);
    String id = (String)params[0];
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement(COUNTSQL,DBTransaction.DEFAULT);
    * Register the first bind parameter as our return value of type CURSOR
    st.registerOutParameter(1,Types.NUMERIC);
    * Set the value of the 2nd bind variable to pass id as argument
    if (id == null) st.setNull(2,Types.VARCHAR);
    else st.setString(2,id);
    st.execute();
    return st.getLong(1);
    catch (SQLException s) {
    throw new JboException(s);
    finally {try {st.close();} catch (SQLException s) {}}
    * Return a JDBC ResultSet representing the REF CURSOR return
    * value from our stored package function.
    private ResultSet retrieveRefCursor(Object qc,String id) {
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement(SQL,DBTransaction.DEFAULT);
    * Register the first bind parameter as our return value of type CURSOR
    st.registerOutParameter(1,OracleTypes.CURSOR);
    * Set the value of the 2nd bind variable to pass id as argument
    if (id == null) st.setNull(2,Types.VARCHAR);
    else st.setString(2,id);
    st.execute();
    ResultSet rs = ((OracleCallableStatement)st).getCursor(1);
    * Make this result set use the fetch size from our View Object settings
    rs.setFetchSize(getFetchSize());
    return rs ;
    catch (SQLException s) {
    s.printStackTrace();
    throw new JboException(s);
    finally {try {st.close();} catch (SQLException s) {}}
    * Store a new result set in the query-collection-private user-data context
    private void storeNewResultSet(Object qc, ResultSet rs) {
    ResultSet existingRs = getResultSet(qc);
    // If this query collection is getting reused, close out any previous rowset
    if (existingRs != null) {
    try {existingRs.close();} catch (SQLException s) {}
    setUserDataForCollection(qc,rs);
    hasNextForCollection(qc); // Prime the pump with the first row.
    * Retrieve the result set wrapper from the query-collection user-data
    private ResultSet getResultSet(Object qc) {
    return (ResultSet)getUserDataForCollection(qc);
    * Return either null or a new oracle.jbo.domain.Date
    private static Date nullOrNewDate(Timestamp t) {
    return t != null ? new Date(t) : null;
    * Return either null or a new oracle.jbo.domain.Number
    private static Number nullOrNewNumber(BigDecimal b) {
    try {
    return b != null ? new Number(b) : null;
    catch (SQLException s) { }
    return null;
    Struts Action
    package org.adb.sls.view;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.ViewObject;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import oracle.adf.model.binding.DCDataControl;
    import oracle.adf.model.bc4j.DCJboDataControl;
    import oracle.jbo.html.BC4JContext;
    public class IndexAction extends DefaultADFAction
    protected ActionForward performActionLogic(ActionMapping mapping,
    ActionForm form, HttpServletRequest request,
    HttpServletResponse response)
    throws Exception {
    try {    
    ApplicationModule am = getApplicationModule("SLSApplicableLoanTypesDataControl", request);
    if (am == null)
    System.out.println("am is null");
    ViewObject vo = am.findViewObject("ViewApplicableLoanTypes");
    vo.setWhereClauseParam(0,request.getSession().getAttribute("SSO_EMPLOYEE_NUMBER"));
    vo.executeQuery();
    } catch (Exception e)
    e.printStackTrace();
    return mapping.findForward("success");
    Struts Config
    <form-beans>
    <form-bean name="DataForm" type="oracle.adf.controller.struts.forms.BindingContainerActionForm"/>
    </form-beans>
    <action-mappings>
    <action path="/index" className="oracle.adf.controller.struts.actions.DataActionMapping" type="org.adb.sls.view.IndexAction" name="DataForm" unknown="false">
    <set-property property="modelReference" value="indexUIModel"/>
    <forward name="success" path="/home.do"/>
    </action>
    <action path="/home" className="oracle.adf.controller.struts.actions.DataActionMapping" type="oracle.adf.controller.struts.actions.DataForwardAction" name="DataForm" parameter="/index.uix" unknown="true">
    <set-property property="modelReference" value="indexUIModel"/>
    </action>
    </action-mappings>

    I just found the solution. I've overridden setWhereClause method.
    public void setWhereClauseParams(Object[] values)
    ViewObjectImpl vo = (ViewObjectImpl) super.getViewObject();
    vo.setWhereClauseParam(0,values[0]);
    }

  • How to generate dynemic GET/SET Method in Struts.....

    hi,
    experts,
    i m doing struts application and i get struct at generatting GET/SET properties for my Dynemic html form in that form i fetch control name and related properties from database and i want to access this properties in action with the help of form which generates dynemic GET/SET properties depends on form controls
    how would i do please give some hints...
    example:
    my html form:
    <html:text name="bpmAttrForm" property="attrName"></html:text>
    . dynemic controls( i don't no how many )
    my form in struts
    public void getX()
    public void setX()
    .... dynemic GET/SET Properties ( i don't no how many )
    like this....
    thnks.....

    Hi ,
    You would have to create a Dynamic form class extending DynaActionForm and ovrride get and set method. In the implementation you access the dyanValues HashMap of DyanActionForm to set and get values from it.
    package yourpackage;
    import org.apache.struts.action.DynaActionForm;
    public class DynaForm extends DynaActionForm
      public Object get(String name)
          Object value = dynaValues.get(name);
          return (value);
      public void set(String name, Object value)
          dynaValues.put(name, value);
    }now in your struts configuration would be
    <form-bean name="myDynaForm" type="yourpackage.DynaForm" />
    if your action class execute method you would have to add and retrive your form properties through the map.
    DynaActionForm myDynaForm = (DynaActionForm) form;
    String prop1  = (String)myDyanaForm .get(propertyName);in your jsp you can access properties using expression library
    ${myDynaForm.map.propertyName}
    Cheers
    Masood

  • Struts database result set storage structure

    Hi all. I am working on a struts application that will return results from a database. The question that I am currently uncertain of is how I should be storing the information from the database. I had thought about using a datastructure to store all of the results and then realized that would be unrealistic given the possible result size. I have instead decided to store only the items that will be displayed on the page. I just wanted to see if this seems like a reasonable idea, given that most people find what they are looking for on the first page or two. Any other thoughts on this would be appreciated.

    No that's why I was thinking of using a resultsetin
    the Session. I am guessing that I'll need to do
    profiling in order to determine the size that Iwill
    use. I was thinking of using between 20-50results
    per page, leaning more heavily to the 20 - doesthat
    sound reasonable ?Yes, but why pass that result set around for that? It
    only might give you problems because you can't close
    the statement that created it without passing that
    around as well. If you close either at all. Also, a
    JSP should never have to deal with DB access. It's
    just supposed to display data, not to retrieve it.I guess I should have been more explicit. I will be passing around 20-50 results stored in their own datastructure. I was using the word resultset but should have instead been using simply result. Thanks for the info.

  • Struts DynaActionForm's set method - is it correctly implemented?

    Dear people:
    I'm trying to make a struts based application that
    chain-forwards a single request via two struts action classes.
    when a user submits the form post, the first struts action receives the form, does some processings and forwards it to the next action.
    however, just before it's forwarding the action,
    it needs to change the DynaActionForm settings that it
    received to another value:
    ((DynaActionForm)form).set("event","now_do_this");
    and forward to the second action which will receive the
    form and read the value which was set up by
    the first action.
    However, whenever I tried to do this, the second action
    simply couldn't get the set up value from first action.
    I've searched around couple of struts tutorial sites
    and this should be working:
    http://www.exadel.com/tutorial/struts/5.2/guess/strutstutorial-dynaform.html
    So what I want to know is:
    is JDeveloper's (oracle's) struts runtime not properly
    functioning?
    or, is it my mistake to misunderstand the struts?
    Any comments are welcomed.

    I have not come across anything call validation.xml.
    All that I know is that if validate is specify to true in the ActionMapping inside struts-config.xml, the validate() method in ActionForm will be invoked.
    RequestProcessor that ActionServlet delegates to will pass the user to the "input" attribute specified in the ActionMapping inside struts-config.xml. Since action() method actually returns an ActionErrors object whereby if it is empty then consider there are no erros and RequestProcessor will proceed with getting the Action and invoked its execute() method.....which will then return a ActionForward object.......
    I hope what i mention is correct.

Maybe you are looking for

  • Ipod won't restore, not recognized by pc or itunes

    Pressing the select and menu buttons will not restore the ipod. My PC does not recognize the ipod as a disk on the computer and itunes does not recognize the ipdod so it won't update. This also means the ipod updater program won't work to update my i

  • Where can I get a replacement drive for my Macbook 2007?

    My hard disk on my 2007 Macbook died. Where can I get a replacement? Any ideas on third party?

  • Administrator rights - unable to obtain on new install of leopard

    Hi! I have installed Leopard (10.5) on my new macbook but have been unable to gain administrator rights..... Having contacted Apple, I was advised to use the Install DVD and re-set the password via the Utilities window. Nice idea... but when loading

  • Default calender stamp in infoview ( webi/deki)

    I am facing a problem related to date formats when picked from calender. I have noticed this in almost all ful client reports viewed through infoview. I am using a date object in the prompt, this object is set as mm/dd/yyyy format in the universe. Wh

  • ARP cache error

    We have a SBS 2003 server running with a standard dual network configuration.  One card for accessing the internet and the other card to connect the server to the local network. We frequently lose our internet connection for an unknown reason (althou