Problem with Struts!

hi,
          i've written a servlet ------
          import org.apache.struts.digester.Digester;
          which gives error while compiling as--------
          cannot resolve symbol
          symbol : class Digester
          location: package digester
          import org.apache.struts.digester.Digester;
          after this somebody suggested me to----
          keep commons jar(common-*.jar) files in classpath.
          struts use Apache Commons' also.
          i did this also.....
          but still the same error arrises
          thanx
          ---Amita
          

"amita" == amita <[email protected]> writes:
                    amita> hi,
          amita> i've written a servlet ------
          amita> import org.apache.struts.digester.Digester;
          amita> which gives error while compiling as--------
          amita> cannot resolve symbol
          amita> symbol : class Digester
          amita> location: package digester
          amita> import org.apache.struts.digester.Digester;
          amita> after this somebody suggested me to----
          amita> keep commons jar(common-*.jar) files in classpath.
          amita> struts use Apache Commons' also.
          amita> i did this also.....
          amita> but still the same error arrises
          There are two issues here. One is making the classes properly available at
          deployment/runtime. The other is making them available at compile time. Your
          call to the "javac" task (I assume you're using Ant) needs to specify the
          commons jar files in its classpath. Don't bother setting the CLASSPATH
          environment variable.
          At deployment, make sure that the "commons" jar files are in your WEB-INF/lib
          directory of your web application.
          ===================================================================
          David M. Karr ; Java/J2EE/XML/Unix/C++
          [email protected] ; SCJP; SCWCD
          

Similar Messages

  • A problem with struts -  DispatchAction class

    Hi,
    I am facing a problem with DispatchAction class in struts 1.1.
    Here is my senario:
    I have a two classes that extend DispatchAction - classA and classB.
    In classA, I have a start method. In classB, I have two methods - display and submit.
    When my application starts, my index.jsp does a logic:forward to the struts-config.xml file.
    e.g.:
    index.jsp<logic:forward name="startApp"/>
    struts-config.xml<form-beans>
         <form-bean name="testFormBean" type="package.testFormBean">
         </form-bean>
    </form-beans>
    <global-forwards>
         <forward name="startApp" path="/startApp.do?method=start"/>
    </global-forwards>
    <action-mappings>
         <action name="testFormBean"
    path="/startApp"
    parameter="method"
    validate="false"
    scope="request"
    type="package.StartAppActions">
         <forward name="successOneUser" path="/runSearch.do?method=display"/>
         </action>
         <action name="testBean"
    path="/runSearch"
    parameter="method"
    validate="false"
    scope="request"
    type="package.SearchActions">
                   <forward name="success" path="/html/jsps/success.jsp"/>
         </action>
    </action-mappings>
    when my application starts, the control goes to the index.jsp and then because of the logic forward goes to the start method of the /startApp action(i.e. the StartAppActions class). I return a ActionForward element with the value of "successOneUser".
    Uptill this point everything works fine.
    But now it should go the /runSearch element (i.e. SearchActions class) and the display method of it. But it is not going there. The error I am getting is action[runSearch] does not have a method named "start".
    I checked the value for the method parameter using the RAD/WSAD debugger, the value of parameter is "method" is still "start".
    I do not understand why it is not overiding the value of parameter "method" with display even though I am doing a
    <forward name="successOneUser" path="/runSearch.do?method=display"/> in the /startApp element, which should send the control to the display method of the [runSearch] element (i.e. in the startActions class).
    Can anyone tell me what the problem is ?
    Thanks in advance.
    kaushal

    Try this:
    Runtime.getRuntime().exec("your_batch_file.bat");
    where your_batch_file is:
    SET CLASSPATH=....(place all needed classes here)
    javac.exe filename
    must work,but there is some limitation...
    you must think to solve this problems.
    i hope that will help,
    Marius

  • Help! Problem with Struts tag html:errors/

    Hi everybody,
    In my JSP page called addUser.jsp, i have the different Struts Tag
    <html:errors/>
    <html:form action="/addUser" focus="firstName">
    </html:form>
    I have of course the ApplicationResources.properties file with differents Struts properties:
    errors.footer=</ul><hr>
    errors.header=<h3><font color="red">Validation Error</font></h3>You must correct the following error(s) before proceeding:<ul>
    errors.ioException=I/O exception rendering error messages: {0}
    and an other one:
    error.fieldsNeeded=<font color="#FF0000">Some fields are missing.</font>
    when I call the addUser form, my JSP page display:
    null Some fields are missing. null
    Have u any suggestion about my prob?
    tx a lot
    s.

    Hi,
    can u post the java code where u are actually adding the error to the action errors. may be there is something wrong with that. I dont see any problem with the jsp or the applicationsResources.properties.
    Thanks
    Latha

  • Lost Locale problem with Struts/Validator Plugin client side validation

    Has anyone else had problems losing the locale in the generated javascript ?
    With the following tiles def and layout (nmLayout.jsp) I can get the locale from the browser OK with
    <html:html locale="true"> and it works ok for imported text (picking up the enCA properties file. But when the javascript executes in the provisionCustomer.jsp the locale reverts to the default property file.
    The Strruts Validator loses the locale of the containing html page. (I do a show source.) I've tried an explicit <fmt:setLocale value="en_CA" scope="session"/> but this has no effect either.
    Thanks
    Bruce
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE tiles-definitions PUBLIC
    "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
    "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
    <!--
    Tiles definition file
    -->
    <tiles-definitions>
    <definition name="nm.MainMenu" path="/nmLayout.jsp">
    <put name="pageTitle" value="Distibutel Network Management" />
    <put name="header" value="header.jsp" />
    <put name="body" value="mainMenuBody.jsp" />
    <put name="footer" value="footer.jsp" />
    </definition>
    <definition name="nm.customer" path="/nmLayout.jsp">
    <put name="pageTitle" value="Distibutel Network Management -- Provision Customer" />
    <put name="header" value="header.jsp" />
    <put name="body" value="provisionCustomer.jsp" />
    <put name="footer" value="footer.jsp" />
    </definition>
    <!-- sample tiles definitions
    <definition name=".mainLayout" path="/common/layouts/classicLayout.jsp">
    <put name="title" value="Sample Page Title" />
    <put name="header" value="/common/header.jsp" />
    <put name="menu" value=".mainMenu" />
    <put name="footer" value="/common/footer.jsp" />
    <put name="body" value=".portal.body" />
    </definition>
    <definition name=".mainMenu" path="/common/layouts/vboxLayout.jsp" >
    <putList name="list" >
    <add value=".menu.links" />
    <add value=".menu.taglib.references" />
    <add value=".menu.printer.friendly" />
    <add value=".menu.old.documents" />
    </putList>
    </definition>
    <definition name="aPage" extends=".mainLayout">
    <put name="title" value="Another Title" />
    <put name="body" value=".aPage.body" />
    </definition>
    end samples -->
    <definition name="${YOUR_DEFINITION_HERE}">
    </definition>
    </tiles-definitions>
    nmLayout.jsp :
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
    <%@ taglib uri="http://struts-menu.sf.net/tag" prefix="menu" %>
    <%@ taglib uri="http://struts-menu.sf.net/tag-el" prefix="menu-el" %>
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
    <%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %>
    <html:html locale="true">
    <head>
    <title><tiles:getAsString name="pageTitle"/></title>
    <link rel="stylesheet" type="text/css" media="screen"
    href="styles/global.css" />
    <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
    <style type="text/css">
    body { background: AliceBlue; }
    #appcontent {
                             position:absolute;
                             top: 300px;
                             left: 200px;
                   h1 {color: red;}
                   h2 {color: green;}
    </style>
    </head>
    <body topmargin="0" leftmargin="0">
    <!--
         <fmt:setBundle basename="ApplicationResources"/>
         <fmt:setLocale value="en_CA" scope="session"/>
    -->     
         <script type="text/javascript" src="./scripts/coolmenus3.js"></script>
         <!-- Custom config for this example -->
         <script type="text/javascript" src="./scripts/coolmenu2-config.js"></script>
         <menu:useMenuDisplayer name="CoolMenu"
         bundle="org.apache.struts.action.MESSAGE">
         <menu:displayMenu name="ToDoListMenuProvision"/>
         </menu:useMenuDisplayer>
    <table>
    <tr>
    <td><tiles:insert attribute="header"/></td>
    </tr>
    <tr>
    <td><div id="appcontent"><tiles:insert attribute="body"/></div></td>
    </tr>
    <tr>
    <td><tiles:insert attribute="footer"/></td>
    </tr>
    </table>
    </body>
    </html:html>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
    <html:javascript formName="customerForm" />
    <html:errors/>
    <h1><fmt:message key="ProvisionCustomer.title"/></h1>
    <html:form action="/saveCustomer"
    onsubmit="return validateCustomerForm(this)" >
    <table>
    <tr>
    <td><h2><fmt:message key="ProvisionCustomer.TenantName"/>:</h2></td><td> <html:text property="tenantName"/></td>
    </tr>
    <tr>
    <td><h2><fmt:message key="ProvisionCustomer.TenantID"/>:</h2></td><td> <html:text property="tenantID"/></td>
    </tr>
    <tr>
    <td><h2><fmt:message key="ProvisionCustomer.CustomerID"/>:</h2></td><td> <html:text property="customerID"/></td>
    <td></td><td><input type="submit" value=<fmt:message key="ProvisionCustomer.insert"/>></td>
    </tr>
    </table>
    </html:form>

    you can always get the locale from the request like so....
    <html>
    <%
    request.getLocale().toString();
    %>
    </html>
    you can even stuff it into javascript like so....
    <html>
    <head>
    <script>
    function foo() {
    var locale = '<%=request.getLocale().toString()%>';
    </script>
    </head>
    </html>
    then you can have access to it in javascript code.

  • Problem with struts validator on WLS 8.1

    I am having a strange problem, when I run my app in eclipse using weblogic plugin it works fine and I get no exception. As soon as I run it externally in a standalone server I get an ServletException which seem be be because of struts validator classes. I have checked the classpath and it seems to be identical in eclipse and startweblogic.cmd
              By the way, this code works fine on WLS 6.0
              Root cause of ServletException.
              javax.servlet.jsp.JspException: ServletException in '/common/sea-layout.jsp': ServletException in '/secure/sea
              -basicBOL-body.jsp': org/apache/commons/validator/Validator
              at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:921)
              at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:460)
              at jsp_servlet._secure.__basicbol._jspService(__basicbol.java:368)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
              at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
              at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:322)
              at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
              at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:261)
              at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:388)
              at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:316)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
              at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
              at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.jav
              a:6718)
              at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
              at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
              Any pointer to fix this situation will be greatly appreciated.
              -Sankate

    Got the solution.
              It was an classloader issue and I fixed by modifying the way EAR was getting packaged.
              I was including all commons-validation.jar and other commons jars in WEB-INF/lib dir. Some how it worked on WLS 6.0 but was not able to load the jars in WLS 8.1
              Move the jars out of lib dir and copy them to app/lib dir and add them to ejb manifest file because ejb jar is loaded before WAR by the classloader. This way when WAR is loaded, all the required jars are already loaded.
              I was getting servletexception and was not able to get to the root of exception (i.e. its a NullPointerexception or NoClassDefFoundException etc) so I added a scriplet in the root jsp and caught Throwable, that was I came to know the root of the problem.
              -Sankate

  • Problem with struts-faces.jar

    hi,
    My requirement is to migrate a struts application to jsf.
    I am using the struts-faces.jar and doing all the configurations as mentioned.I am getting the following error while calling the application itself..
    java.lang.ClassNotFoundException: org.apache.struts.faces.taglib.LifecycleListener
    I am using the following version:
    1)Tried both struts-faces-0.4 and 0.3(downloaded from http://archive.apache.org/dist/struts/struts-faces/)
    2)Tomcat 5.0
    3)jsf-(SUN)
    4)struts 1.1
    Please let me know if i am doing something wrong. and any ways to fix this.
    Regards,
    Mythili

    Given the new release of the JSF ri and api .jar
    files,
    will this .jar provided at the apache site work?
    http://archive.apache.org/dist/jakarta/struts/old/relea
    e/struts-faces/
    No, those JARs only work with the EA versions of JavaServer Faces.
    A nightly build of the struts-faces integration library, that works with the beta release, is available at:
    http://cvs.apache.org/builds/jakarta-struts/nightly/struts-faces/
    and the corresponding source code is part of the Struts nightly build bundles in:
    http://cvs.apache.org/builds/jakarta-struts/nightly/src/
    in directory "contrib/struts-faces".
    This package is not yet ready to be released, but seems to work for me in all the cases where the old library worked before. (If you're migrating, note particularly some tweaks you need to add in the struts-config.xml file for the new version, documented in README.txt.) Work continues on the Tiles integration which feedback has indicated is really important to people.
    Developers who are building new components and renderers will be quite interested in the techniques used to make all the attributes of your own components value-binding-enalbled (like all the ones on the standard tags are). The source code for the <s:form> tag, plus the corresponding component and renderer, will be helpful in illustrating this.
    Craig McClanahan

  • Problem with Struts Validation and apache dtd definition.

    Jakarta Struts
    Java Version 1.5
    We have one web application that is being a little problematic, on startup two errors are thrown relating to the same problem (errors below).
    We get 401 returned for http://jakarta.apache.org/commons/dtds/validator_1_0.dtd
    both the validation.xml and validation-rules.xml have the same doc type set as below:
    <!DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
    We have the same configuration set for several other web application deployed succesfuly on the same tomcat application server without any problems. I'm not sure why this one application is causing a problem, I don't see any difference between the validation.xml and validation-rules.xml files in this application to any of the others that have been succesfully deployed, infact the validation-rules.xml is identical for all the web applications hosted on this server.
    Any ideas appreciated
    Error
    2006-03-30 15:04:50,968 ERROR [HttpRequestHandler-169] validator.ValidatorPlugIn (ValidatorPlugIn.java:224) - Server returned HTTP response code: 401 for URL: http://jakarta.apache.org/commons/dtds/validator_1_0.dtd
    java.io.IOException: Server returned HTTP response code: 401 for URL: http://jakarta.apache.org/commons/dtds/validator_1_0.dtd
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:791)
         at java.net.URL.openStream(URL.java)
         at oracle.xml.parser.v2.XMLReader.openURL(XMLReader.java:2292)
         at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:265)
         at oracle.xml.parser.v2.NonValidatingParser.pushExternalDTD(NonValidatingParser.java:540)
         at oracle.xml.parser.v2.NonValidatingParser.parseDoctypeDecl(NonValidatingParser.java:465)
         at oracle.xml.parser.v2.NonValidatingParser.parseProlog(NonValidatingParser.java:298)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:277)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:184)
         at org.apache.commons.digester.Digester.parse(Digester.java:1515)
         at org.apache.commons.validator.ValidatorResourcesInitializer.initialize(Unknown Source)
         at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:222)
         at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:161)
         at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1158)
         at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
         at javax.servlet.GenericServlet.init(GenericServlet.java:259)
         at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2141)
         at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4582)
         at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4676)
         at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:820)
         at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:542)
         at com.evermind.server.Application.getHttpApplication(Application.java:889)
         at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:690)
         at com.evermind.server.http.HttpSite.getApplication(HttpSite.java:420)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:422)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    2006-03-30 15:04:50,968 INFO [HttpRequestHandler-169] validator.ValidatorPlugIn (ValidatorPlugIn.java:209) - Loading validation rules file from '/WEB-INF/validation.xml'
    2006-03-30 15:04:50,984 ERROR [HttpRequestHandler-169] validator.ValidatorPlugIn (ValidatorPlugIn.java:224) - Server returned HTTP response code: 401 for URL: http://jakarta.apache.org/commons/dtds/validator_1_0.dtd
    java.io.IOException: Server returned HTTP response code: 401 for URL: http://jakarta.apache.org/commons/dtds/validator_1_0.dtd
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:791)
         at java.net.URL.openStream(URL.java)
         at oracle.xml.parser.v2.XMLReader.openURL(XMLReader.java:2292)
         at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:265)
         at oracle.xml.parser.v2.NonValidatingParser.pushExternalDTD(NonValidatingParser.java:540)
         at oracle.xml.parser.v2.NonValidatingParser.parseDoctypeDecl(NonValidatingParser.java:465)
         at oracle.xml.parser.v2.NonValidatingParser.parseProlog(NonValidatingParser.java:298)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:277)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:184)
         at org.apache.commons.digester.Digester.parse(Digester.java:1515)
         at org.apache.commons.validator.ValidatorResourcesInitializer.initialize(Unknown Source)
         at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:222)
         at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:161)
         at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1158)
         at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
         at javax.servlet.GenericServlet.init(GenericServlet.java:259)
         at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2141)
         at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4582)
         at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4676)
         at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:820)
         at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:542)
         at com.evermind.server.Application.getHttpApplication(Application.java:889)
         at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:690)
         at com.evermind.server.http.HttpSite.getApplication(HttpSite.java:420)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:422)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    -----------------------------------------------------------------------

    hi,
    I am also facing the same issue. Could you tell me which are those jar files you were missing & from where you got those?
    regards
    prasanth

  • Problem with struts portlet in Portal

    Hi,
    I would like to make a struts app as a portlet in bea portal.
    But when I try to make it using standard wizard to create Struts portlet
    after point struts-config.xml I get "Cannot parse the struts configuration file".
    What is wrong ? (I tried with many different struts-config.xml files, it doesn't
    work)
    I can't find any error details. in workshop files ?
    I have bea Workshop 8.1.
    Any help ?
    Thanks,
    Tom

    Ok I found solution on
    weblogic.developer.interest.portal.struts
    but where are error details ? which file ?
    "tmm" <[email protected]> wrote:
    >
    Hi,
    I would like to make a struts app as a portlet in bea portal.
    But when I try to make it using standard wizard to create Struts portlet
    after point struts-config.xml I get "Cannot parse the struts configuration
    file".
    What is wrong ? (I tried with many different struts-config.xml files,
    it doesn't
    work)
    I can't find any error details. in workshop files ?
    I have bea Workshop 8.1.
    Any help ?
    Thanks,
    Tom

  • Problems with struts MessageResources.properties files

    hi,
    I am a newbie in using struts. I have the following resources.
    Resources:
    java:j2sdk1.4.X
    struts:1.2.4
    webserver:tomcat 5
    jsp:2.0
    servlets:2.4
    IDE:Ecilipse 3.0 IDE
    Problem: I have copied the struts_blank.war file into tomcat webapps dir. Inside Ecilipse I create a new project and import the struts_blank.war file into the project. I type the URL (http://localhost:8080/proj_struts/Welcome.do)and it works file. However if i create any formbeans or any other java classes, the MessageResources.properties file gets deleted from my classes folder in my dir. What am i doing wrong. Is there any plugin for struts for Ecilipse.
    Questions:
    to be specific, where should/which folder should these .properties files be located. Should they be in classes or src folder under WEBINF?. I have seen the entry in strutsconfig.xml file. All it has is the following element relating to .properties.
    Fixes tried:
    I tried copying the MessageResources.properties file into the sources folder
    but i am not sure how to configure the Eclipse so that it reads the .properties file file from src folder insted of classes. I am definately sure thisis a dumb sol..but i donno wht else to do....
    <!-- ======================================== Message Resources Definitions -->
    <message-resources parameter="MessageResources" />
    It doesnt even say where is it looking(which folder).....
    Could some one throw some light on this issue and guide me thru this ordeal
    Regards
    AK

    Problem: I have copied the struts_blank.war file into
    tomcat webapps dir. Inside Ecilipse I create a new
    project and import the struts_blank.war file into the
    project. I type the URL
    (http://localhost:8080/proj_struts/Welcome.do)and it
    works file. However if i create any formbeans or any
    other java classes, the MessageResources.properties
    file gets deleted from my classes folder in my dir.No idea why this should happen.
    What am i doing wrong. Is there any plugin for struts
    for Ecilipse. http://easystruts.sourceforge.net/
    Questions:
    to be specific, where should/which folder should
    these .properties files be located. Should they be in
    classes or src folder under WEBINF?. I have seen the
    entry in strutsconfig.xml file. All it has is the
    following element relating to .properties.WEB-INF/classes, if nothing is specified :)
    Fixes tried:
    I tried copying the MessageResources.properties file
    into the sources folder
    but i am not sure how to configure the Eclipse so
    that it reads the .properties file file from src
    folder insted of classes. I am definately sure thisis
    a dumb sol..but i donno wht else to do....This solution may not be so dumb after all. The only thing you missed out was that Eclipse doesn't copy any files other than classes. Maybe a custom Ant script would have done such a trick :)
    <!-- ======================================== Message
    Resources Definitions -->
    <message-resources parameter="MessageResources"
    ces" />
    It doesnt even say where is it looking(which
    folder).....As I said earlier, it's looking in WEB-INF/classes

  • Gallery web tier : problem with struts

    Hi,
    With both jdeveloper10g 9.0.5.2 & 10.1.2 I only have 'Struts Controller Page Flow' in Struts (File/New/New gallery/WebTier/Struts) -> no ActionForm, Starter application like in tutorials :( .
    I plugged struts 1.2.6, nothing more happens...
    How can I make those options appear ?
    Thanks for your help :)

    Hi,
    Open the Struts Controller Page Flow diagram in teh visual editor and open the Component Palette to access the Struts Action component and Action Forms.
    Frank

  • Problem with Struts file upload with small files

    For some reason, when I try to upload a file that is smaller than 45 bytes using Struts (took me a long time to find this number), by the time the file is populated in my form bean and I read the size from it, the size is 0. Has anyone encountered this problem before?
    I created a file called test.txt, which contained the following text in it: "This is a test.". This file is about 15 bytes in size. When I was trying to upload this file using Struts, and write it to a temp file, my temp file always was of size 0. At first I was convinced it was my code, but then I tried a Word file (about 19kb), and it worked fine. Finally, I added some debug code at the beginning of my execute() method in my action to print out all the metadata for uploaded files, and I saw the the file size was 0 for files smaller than 45 bytes. I printed this just after I cast the form to be the type of form that I needed. What is happening to the contents of the file? Does Struts have a minimum size limit of files that it is able to process?
    Any help is greatly appreciated!

    AFter some more testing, I found that this is only a problem when using Firefox and Netscape. When using IE, files as small as 1 byte were properly uploaded, and the size was accurate when queried from FormFile.getFileSize().
    Does anyone have any ideas as to what may be happening in this case? Why it would work fine in one browser and not the other?

  • Problem With Struts Tiles When Migrating from WL 8.1 to WL 10.3

    Hi Folks,
    When migration my project from WL 8.1 to WL 10.3, I got the follow error :
    javax.servlet.jsp.JspException: Can't insert page '/tile/tilePesquisa.jsp' : null
         at org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:902)
         at org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465)
         at jsp_servlet._web_45_inf._jsp._ferramenta._ferramenta.__listaferramenta._jspService(__listaferramenta.java:361)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
         at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:505)
         at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:251)
         at org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
         at org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
         at org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
         at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
         at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
         at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
         at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
         at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    Can anybody help me ?
    So do I need change some XML configuration file such as web.xml or weblogic xml ?
    Thanks!!

    Hi,
    I have realized the follow:
    The error occurs on:
         <tiles:put name="pageTitle" direct="true">
              <tiles:get name="pageTitle" />
         </tiles:put>
    if I change to:
         <tiles:put name="pageTitle" direct="true">
              <tiles:getAsString name="pageTitle" />
         </tiles:put>
    it works!?
    But the application is entire using the first code example ! I need other solution to this!
    Thanks!

  • Problem with struts-config

    hi all,
    i have using struts. i have written struts-config file which is giving some error while start the tomcat 5.xxx
    struts-config shown below
    <?xml version="1.0" encoding="ISO-8859-1" ?>
        <!DOCTYPE struts-config PUBLIC
                  "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
                  "http://struts.apache.org/dtds/struts-config_1_2.dtd">
         <struts-config>
        <message-resources parameter="resources.application"/>
        <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor" />
        <plug-in className="org.apache.struts.tiles.TilesPlugin">
            <set-property property="definitions-config"
                value="/WEB-INF/tiles-admin-defs.xml"/>
            <set-property property="moduleAware" value="true"/>
            <set-property property="definitions-parser-validate" value="true"/>
        </plug-in>
        </struts-config>error is
    must match "(display-name?,description?,data-sources?,form-beans?,global-excep
    ons?,global-forwards?,action-mappings?,controller?,message-resources*,plug-in*
    org.xml.sax.SAXParseException: The content of element type "struts-config" mus
    match "(display-name?,description?,data-sources?,form-beans?,global-exceptions
    global-forwards?,action-mappings?,controller?,message-resources*,plug-in*)".
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(
    known Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    please tell me what did i made wrong

    Maybe it makes more sense to ask here
    http://jguru.com/forums/Struts
    Or at the Jakarta mailing list for Struts.

  • Trying to submit back to jsp with struts

    Ok, so I have a jsp page that displays tons of stuff.
    I get there from the struts flow of:
    InputFormJsp -> strutsFormBean ->strutsActionBean->JSP View Page
    So I'm at my view page and I was to resubmit back to the view page again using a bunch of hidden input fields to redo the page with different vars (historic data, based on the 1st time through).
    So it will go:
    JSP View Page->strutsFormBean->strutsActionBean->JSP View Page
    I want to use the same form and action beans and the same view page, just want to pass the hidden vars instead of prompting the user all over again.
    I have my form and hidden fields set up, but my problem is how do I get struts to see the resubmit. I made a new actionmapping that labeled the "input" as the same jsp page as the forward but I keep getting:
    javax.servlet.ServletException
         org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)
         org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)followed by a good old NullPointerException from my actionbean's execute method (I think):
    root cause
    java.lang.NullPointerException
         com.air2web.SysReportAction.execute(SysReportAction.java:85)
         org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)struts-config.xml looks like:
    <action   path="/getSysReport"
                  type="com.air2web.SysReportAction"
                  name="SysReportForm"
                  input="/pages/SysReport.jsp"
                  scope="request">
        <forward name="success" path="/pages/genSysReport.jsp"/>         
        </action>
    <action   path="/getSysReportHistoric"
                  type="com.air2web.SysReportAction"
                  name="SysReportForm"
                  input="/pages/genSysReport.jsp"
                  scope="request">
        <forward name="success" path="/pages/genSysReport.jsp"/>         
        </action>Is there a way to specify many input pages or some other trick to do this??
    Thanks
    Chris Liles

    I had exactly the same problem with Struts, and Finally I solve this.
    first of all put into <form-beans> the form path
        <form-bean name="updUserForm" type="com.yourcompany.struts.form.UpdUserForm" />and in <action-mappings >
        <action
          attribute="updUserForm"
          input="/UpdateUser.jsp"
          name="updUserForm"
          path="/updUser"
          scope="request"
          type="com.yourcompany.struts.action.UpdUserAction" >
          <forward name="success" path="/MyJsp.jsp" />
        </action>Be carefull with the first letter of attribute and name they must be in minus! (Instead of mayus in form).
    For more ..
    [email protected]

  • Weblogic 10.0 Problems with stripes/struts

    When trying to deploy the sample application for the stripes framework on weblogic 10.0 I get the following error when deploying.
    <Dec 3, 2009 12:16:51 PM CET> <Error> <HTTP> <BEA-101165>
    <Could not load user defined filter in web.xml:
    net.sourceforge.stripes.controller.StripesFilter.net.sourceforge.stripes.exception.StripesRuntimeException:
    Problem instantiating default configuration objects.I actually had to switch to using the Sun JDK to get this error. JRockit does not report it, and just fails when I try to use the application. The problem appear to be weblogic 10.0 specific. No problems with jetty or tomcat, and I've heard reports that it is resolved in weblogic 10.3. Have ayone come accross similar problems when using stripes/struts on weblogic 10.0, and found a solution to this? Is there a patch available for 10.0 than fix this?
    Regards
    Morten
    PS: I have ommited the complete stack trace, since it is monstrously huge.

    Guess I was wrong in thinking that this was an isolated weblogic 10.0 problem. I just downloaded weblogic 10.3 and tried to deploy the same application there, and the same error happened.
    <03.des.2009 kl 15.12 CET> <Error> <HTTP> <BEA-101165>
    <Could not load user defined filter in web.xml:
    net.sourceforge.stripes.controller.StripesFilter.net.sourceforge.stripes.exception.StripesRuntimeException:
    Problem instantiating default configuration objects.
            at net.sourceforge.stripes.config.DefaultConfiguration.init(DefaultConfiguration.java:220)
            at net.sourceforge.stripes.config.RuntimeConfiguration.init(RuntimeConfiguration.java:272)
            at net.sourceforge.stripes.controller.StripesFilter.init(StripesFilter.java:125)
            at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:329)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
            Truncated. see log file for complete stacktrace
    java.lang.NullPointerException
            at java.io.FilterInputStream.read(FilterInputStream.java:116)
            at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
            at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
            at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
            at java.io.InputStreamReader.read(InputStreamReader.java:167)
            Truncated. see log file for complete stacktraceSo is there anyone out there with experience with struts/stripes, that can tell why this does not work? If you need to try this yourself, you can download the stripes sample application here:
    http://sourceforge.net/projects/stripes/files/stripes/Stripes%201.5.2/stripes-1.5.2.zip/download
    There is an example WAR called "stripes-examples.war" in the zip that is ready to be deployed.
    Regards
    Morten
    PS: you still need to start weblogic with Sun JDK rather than JRockit to get the error. With JRockit the application simply fails when used.

Maybe you are looking for

  • How to update the sales order header & item data in TM system

    Hi Experts, Greetings! I need your help,I have a one requirement sales order data came from ECC these sales order data need to update in TM Sales order header table as well as item table also these fields are additional fields. Can anyone please guid

  • How do I convert a Vector to be passed into the session

    Hi I have a vector in a JSP that I need to pass on to a second JSP. I use the following command to do that just as I pass normal other strings: session.setAttribute("MyVector",vecData); But the follwoing error is been thrown by Tomcat. Incompatible t

  • Translation of an InDesign document

    The newsletter I put out for work requires publishing in both English and Portuguese. I do not speak Portuguese and we use a translator. Prior to my arrival in this position, the newsletter was designed in Microsoft Publisher and was sent to the tran

  • Calendar date variable problem in queries

    Hi-We upgraded to NW2004s from BW 3.1 We have an issue with queries when we try to change the value of any variable that is a calendar date such as the Current Calendar Day. Example: when running a query, the Select Values for Variants screen display

  • Content Missing in Published Captive 7 File

    I built a simulation in Captivate 5.5 and qwhen published it worked fine but I have now upgraded to Captivate 7 and saved the file under this version. When publishing the file from Captivate 7 I find that a few screens are missing data epsecially bac