Struts and Application.properties

          I think this has been broached before, but if someone could restate the answer, I
          would be most obliged:
          It appears that WLS 6.1 SP2 does not load properties files (like the typical Struts
          Application.properties) when it loads a webapp. This leads to an exception in my
          Struts apps (that work fine on Tomcat 4.0.3) when it can't find any of the application
          tags.
          Anybody run into this?
          

Name it whatever you want. All that matters is the part before the .properties extension matches what you put in the struts-config.xml:
<!-- Main resource bundle, contains errors and some generic stuff. -->
<message-resources parameter="com.company.app.MainResources"
     null="true"/>
<!-- Alternate resource bundle, contains some special things maybe. -->
<message-resources parameter="com.company.app.AltResources"
     key="altResourceKey" null="true" />
// and have the files...
appdir/WEB-INF/classes/com/company/app/MainResources.properties
appdir/WEB-INF/classes/com/company/app/AltResources.properties
// and use them with the bean:message tag...
<bean:message key="some.main.key" />
<bean:message bundle="altResourceKey" key="some.alt.key" />The only thing that matters is that several Struts tags, like the <html:errors /> for ActionErrors will only use 1 message resource file. The html:errors tag can specify an alternate resource file, but all the error keys used for that html:errors instance must be in that same bundle. So usually I put all my error messages in the main one and if it's a large app, I put several other resource files for different areas of the app.

Similar Messages

  • Struts and Iterated Properties

    Hi all I am in the midst of programming Struts to use iterated properties to iterate through an arrayList of Products and display a bunch of attributes from each Product (such as price, numProducts, description etc)
    Unfortunately I can get the page to display the values, but when I go to post the form the values are not there. The page is of scope=request. I am trying to use the "hand cranked lazy list" solution but not having any luck. If someone can provide a sample with the action, form and the jsp to get this working I will more than hapily provide a pile of dukes. I will post what I have so far shortly.
    thanks.
    Edit
    shoot apprarently 10 is the most you can do for one thread....

    Edit the problem that I am encountering is that it works fine when first showing the form, but when trying to submit the form there is never any results. The page displays, it is simply not displaying any data.
    Results is an array of Products.
    Products have price, numProducts, description etc all with getters and setters
    A protion of the JSP:
    <logic:notEmpty name="ProdSelectionForm" property="results" scope="request">
         <logic:iterate name="ProdSelectionForm" property="results" id="ResultsPage">
         <tr>
              <td>     <html:text  name="ResultsPage" property="description" indexed="true" />      </td>
         </tr>
         </logic:iterate>
    </logic:notEmpty>A protion of the form:
         public Product getResultsPage(int index)
              if(this.results == null)
                   this.results = new ArrayList();
              while(index >= this.results.size())
                   this.results.add(new Product());               
              return (Product) results.get(index);
         public void setResultsPage(int index, Product p)
              if(this.results == null)
                   this.results = new ArrayList();
              while(index >= this.results.size())
                   this.results.add(new Product());               
              results.set(index, p);
         public ArrayList getResultsPage()
              if(this.results == null)
                   this.results = new ArrayList();
              return results;
         public void setResults(ArrayList results)
            this.results=results;
         public ArrayList getResults()
            return this.results;
         }     Aprotion of the action:
         // this is called the first time that the page is hit
         if(action.equals("populate"))
                   order.getProducts();
                   Order  o = user.getOrder(user.getCurrOrderId());
                   prodSelection.setResults(o.getProducts());
                   prodSelection.setResults(o.getProducts());
                   prodSelection.setTest("" +order.getProductsSize()  +" and for order " + o.getProductsSize() );
                   //request.setAttribute("prodSelectionForm", prodSelection);
              // this is called when the user submits the form                    
              if(action.equals("Delete"))
                   pageRes = prodSelection.getResultsPage();
                   int count = 0;
                   ArrayList p = new ArrayList();
                   prodSelection.setTest(prodSelection.getTest()+" NEW: " + pageRes.size()  );
                   return mapping.findForward("success");
              return mapping.findForward("success");
         }

  • Struts - Application.properties and ApplicationResources.properties

    Java Guru's,
    Could some one tell me the difference between Application.properties and ApplicationResources.properties and which one shd i use in my application.
    Thank you in Advance ..

    Name it whatever you want. All that matters is the part before the .properties extension matches what you put in the struts-config.xml:
    <!-- Main resource bundle, contains errors and some generic stuff. -->
    <message-resources parameter="com.company.app.MainResources"
         null="true"/>
    <!-- Alternate resource bundle, contains some special things maybe. -->
    <message-resources parameter="com.company.app.AltResources"
         key="altResourceKey" null="true" />
    // and have the files...
    appdir/WEB-INF/classes/com/company/app/MainResources.properties
    appdir/WEB-INF/classes/com/company/app/AltResources.properties
    // and use them with the bean:message tag...
    <bean:message key="some.main.key" />
    <bean:message bundle="altResourceKey" key="some.alt.key" />The only thing that matters is that several Struts tags, like the <html:errors /> for ActionErrors will only use 1 message resource file. The html:errors tag can specify an alternate resource file, but all the error keys used for that html:errors instance must be in that same bundle. So usually I put all my error messages in the main one and if it's a large app, I put several other resource files for different areas of the app.

  • Struts Application Properties

    I think this has been broached before, but if someone could restate the answer, I
              would be most obliged:
              It appears that WLS 6.1 SP2 does not load properties files (like the typical Struts
              Application.properties) when it loads a webapp. This leads to an exception in my
              Struts apps (that work fine on Tomcat 4.0.3) when it can't find any of the application
              tags.
              Anybody run into this?
              

    Name it whatever you want. All that matters is the part before the .properties extension matches what you put in the struts-config.xml:
    <!-- Main resource bundle, contains errors and some generic stuff. -->
    <message-resources parameter="com.company.app.MainResources"
         null="true"/>
    <!-- Alternate resource bundle, contains some special things maybe. -->
    <message-resources parameter="com.company.app.AltResources"
         key="altResourceKey" null="true" />
    // and have the files...
    appdir/WEB-INF/classes/com/company/app/MainResources.properties
    appdir/WEB-INF/classes/com/company/app/AltResources.properties
    // and use them with the bean:message tag...
    <bean:message key="some.main.key" />
    <bean:message bundle="altResourceKey" key="some.alt.key" />The only thing that matters is that several Struts tags, like the <html:errors /> for ActionErrors will only use 1 message resource file. The html:errors tag can specify an alternate resource file, but all the error keys used for that html:errors instance must be in that same bundle. So usually I put all my error messages in the main one and if it's a large app, I put several other resource files for different areas of the app.

  • Why when i download anything thru firefox and try to run it says its not a win 31 application and the properties show it is empty

    why when i download anything thru firefox and try to run it says its not a valid win 32 application and the properties show it is empty

    -> Tap ALT key or press F10 to show the Menu Bar
    -> go Tools Menu -> Clear Recent History -> '''Time range to clear: select EVERYTHING''' -> click Details (small arrow) button -> place Checkmarks on '''Cookies, Cache''' -> click "Clear Now"
    -> go to Tools Menu -> Options -> Advanced -> Network -> Offline Storage (Cache): click '''Clear Now''' button
    If the problem persist check this link:
    Unable to download or save files
    https://support.mozilla.com/en-US/kb/Unable%20to%20download%20or%20save%20files
    Check and tell if its working.

  • Application.Properties Loosing Content

    I am using Action.Properties to set error codes and display them as part of my validation.
    I am setting the Error in a Validate class using the following Syntax
    errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("error.FirstField.invalid"));
    I am routing control back to homepage incase of an error and printing the same using
    <html:errors/>
    This Works Just FIne, Until i re-build the application.
    Once i re-Build, the content in application.Properties disappears. Just Gone!
    Have you guys had the same problem or do i have the patent this rare finding, LOL

    If you are loosing the complete application.Properties file, the reason may be that you are putting this file at wrong place. I think you are putting it in classes folder and when you re build the complete application, all the existing files are flushed by the newly genrated class files. If you are using any advanced editor like WSAD, you should put this file in a package in Java Source. So that when you rebuild the project, it will be copied as it is in the classes folder. And accordingly you need to change the path of this file into struts-config.xml.

  • Good MVC-based Struts modular application example

    I am searching for some good modular applications in Struts as a reference for the applications we are making. It is hard to find really good examples. Most are too simple with only 2 struts-config.xml files. Also validation, tiles and MessagesResources.properties should be included.
    Even in this URL: http://sourceforge.net/projects/struts I am not able to find a good example.
    We developed several rather complex modular applications in Struts, but we would like to have a good modular application reference...

    silvousplait wrote:
    I am seeking a recommendation to a website, book, etc. that gives an extensive example of building, from scratch, a desktop application (controlling of frames, panels, exceptions, DB).
    I would like it to follow the MVC convention if possible.I'm using two books; The JFC Swing Tutorial for technical reference and Filthy Rich Clients for inspiration.

  • The system could not find a javax.ws.rs.ext.MessageBodyWriter or a DataSourceProvider class for the com.rest.assignment.EmpBean type and application/json mediaType.  Ensure that a javax.ws.rs.ext.MessageBodyWriter exists in the JAX-RS application for the

    Hi,
    Im trying to create a Rest WS with a @GET method that will return me an Emp object. I need the output as a JSON string.
    I have created a dynamic web project and added javax RS jars:
    When im trying to run this, i'm getting the below mentioned error:
    FlushResultHa E org.apache.wink.server.internal.handlers.FlushResultHandler handleResponse The system could not find a javax.ws.rs.ext.MessageBodyWriter or a DataSourceProvider class for the com.rest.assignment.EmpBean type and application/json mediaType.  Ensure that a javax.ws.rs.ext.MessageBodyWriter exists in the JAX-RS application for the type and media type specified.
    RequestProces I org.apache.wink.server.internal.RequestProcessor logException The following error occurred during the invocation of the handlers chain: WebApplicationException (500 - Internal Server Error)
    Please help as im stuck with this from long.
    Thanks in advance.
    Below is the code for my service class:
    package com.rest.assignment;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.util.Enumeration;
    import java.util.HashSet;
    import java.util.Properties;
    import java.util.Set;
    import javax.ws.rs.GET;
    import javax.ws.rs.Path;
    import javax.ws.rs.Produces;
    import javax.ws.rs.core.Application;
    import javax.ws.rs.core.MediaType;
    import javax.ws.rs.core.Response;
    @Path("/restService")
    public class RestService extends Application {   
        @GET
        @Path("/getEmpDetails")
        @Produces(MediaType.APPLICATION_JSON)
        public Response getStringResponse()
            EmpBean empBean = new EmpBean();
            String filePath = "C:/Program Files/IBM/workspace/HelloWorld/src/com/rest/resources/EmpData.properties";
            Properties properties = new Properties();
            try {
                properties.load(new FileInputStream(filePath));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
             Enumeration e = properties.propertyNames();
             String result="";
            String[] empDetailsArr;
            while (e.hasMoreElements()) {
              String key = (String) e.nextElement();
              String empDetails = properties.getProperty(key);
              empDetailsArr=empDetails.split(",");    
              empBean.setFirstName(empDetailsArr[0]);
              empBean.setLastName(empDetailsArr[1]);
              empBean.setEmpId(empDetailsArr[2]);
              empBean.setDesignation(empDetailsArr[3]);
              empBean.setSkillSet(empDetailsArr[4]);
              result = empDetailsArr[1];
            //return empBean;
            return Response.ok(empBean).type(MediaType.APPLICATION_JSON_TYPE).build();
        @Override
        public Set<Class<?>> getClasses() {
            Set<Class<?>> classes = new HashSet<Class<?>>();
            classes.add(RestService.class);
            classes.add(EmpBean.class);
            return classes;
    and my empBean goes like this:
    package com.rest.assignment;
    public class EmpBean {
        private String firstName;
        private String lastName;
        private String empId;
        private String designation;
        private String skillSet;
        public String getFirstName() {
            return firstName;
        public void setFirstName(String firstName) {
            this.firstName = firstName;
        public String getLastName() {
            return lastName;
        public void setLastName(String lastName) {
            this.lastName = lastName;
        public String getEmpId() {
            return empId;
        public void setEmpId(String empId) {
            this.empId = empId;
        public String getDesignation() {
            return designation;
        public void setDesignation(String designation) {
            this.designation = designation;
        public String getSkillSet() {
            return skillSet;
        public void setSkillSet(String skillSet) {
            this.skillSet = skillSet;
    Web.xml goes like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <display-name>restWS</display-name>
    <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>default.html</welcome-file>
      <welcome-file>default.htm</welcome-file>
      <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
    <servlet>
      <servlet-name>REST</servlet-name>
      <servlet-class>com.ibm.websphere.jaxrs.server.IBMRestServlet</servlet-class>
      <init-param>
       <param-name>javax.ws.rs.Application</param-name>
       <param-value>com.rest.assignment.RestService</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
      <servlet-name>REST</servlet-name>
      <url-pattern>/rest/*</url-pattern>
    </servlet-mapping>
    </web-app>
    When i try to return a string from my get method, it gives me a proper response. i get this exception when im trying to return a JSON response.

    Hi,
    Im trying to create a Rest WS with a @GET method that will return me an Emp object. I need the output as a JSON string.
    I have created a dynamic web project and added javax RS jars:
    When im trying to run this, i'm getting the below mentioned error:
    FlushResultHa E org.apache.wink.server.internal.handlers.FlushResultHandler handleResponse The system could not find a javax.ws.rs.ext.MessageBodyWriter or a DataSourceProvider class for the com.rest.assignment.EmpBean type and application/json mediaType.  Ensure that a javax.ws.rs.ext.MessageBodyWriter exists in the JAX-RS application for the type and media type specified.
    RequestProces I org.apache.wink.server.internal.RequestProcessor logException The following error occurred during the invocation of the handlers chain: WebApplicationException (500 - Internal Server Error)
    Please help as im stuck with this from long.
    Thanks in advance.
    Below is the code for my service class:
    package com.rest.assignment;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.util.Enumeration;
    import java.util.HashSet;
    import java.util.Properties;
    import java.util.Set;
    import javax.ws.rs.GET;
    import javax.ws.rs.Path;
    import javax.ws.rs.Produces;
    import javax.ws.rs.core.Application;
    import javax.ws.rs.core.MediaType;
    import javax.ws.rs.core.Response;
    @Path("/restService")
    public class RestService extends Application {   
        @GET
        @Path("/getEmpDetails")
        @Produces(MediaType.APPLICATION_JSON)
        public Response getStringResponse()
            EmpBean empBean = new EmpBean();
            String filePath = "C:/Program Files/IBM/workspace/HelloWorld/src/com/rest/resources/EmpData.properties";
            Properties properties = new Properties();
            try {
                properties.load(new FileInputStream(filePath));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
             Enumeration e = properties.propertyNames();
             String result="";
            String[] empDetailsArr;
            while (e.hasMoreElements()) {
              String key = (String) e.nextElement();
              String empDetails = properties.getProperty(key);
              empDetailsArr=empDetails.split(",");    
              empBean.setFirstName(empDetailsArr[0]);
              empBean.setLastName(empDetailsArr[1]);
              empBean.setEmpId(empDetailsArr[2]);
              empBean.setDesignation(empDetailsArr[3]);
              empBean.setSkillSet(empDetailsArr[4]);
              result = empDetailsArr[1];
            //return empBean;
            return Response.ok(empBean).type(MediaType.APPLICATION_JSON_TYPE).build();
        @Override
        public Set<Class<?>> getClasses() {
            Set<Class<?>> classes = new HashSet<Class<?>>();
            classes.add(RestService.class);
            classes.add(EmpBean.class);
            return classes;
    and my empBean goes like this:
    package com.rest.assignment;
    public class EmpBean {
        private String firstName;
        private String lastName;
        private String empId;
        private String designation;
        private String skillSet;
        public String getFirstName() {
            return firstName;
        public void setFirstName(String firstName) {
            this.firstName = firstName;
        public String getLastName() {
            return lastName;
        public void setLastName(String lastName) {
            this.lastName = lastName;
        public String getEmpId() {
            return empId;
        public void setEmpId(String empId) {
            this.empId = empId;
        public String getDesignation() {
            return designation;
        public void setDesignation(String designation) {
            this.designation = designation;
        public String getSkillSet() {
            return skillSet;
        public void setSkillSet(String skillSet) {
            this.skillSet = skillSet;
    Web.xml goes like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <display-name>restWS</display-name>
    <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>default.html</welcome-file>
      <welcome-file>default.htm</welcome-file>
      <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
    <servlet>
      <servlet-name>REST</servlet-name>
      <servlet-class>com.ibm.websphere.jaxrs.server.IBMRestServlet</servlet-class>
      <init-param>
       <param-name>javax.ws.rs.Application</param-name>
       <param-value>com.rest.assignment.RestService</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
      <servlet-name>REST</servlet-name>
      <url-pattern>/rest/*</url-pattern>
    </servlet-mapping>
    </web-app>
    When i try to return a string from my get method, it gives me a proper response. i get this exception when im trying to return a JSON response.

  • How to set buildID.xml and custom.properties in SDK

    Hello,
    I just completed a new build deployment of SAP ME5.2, because after I deployed the new version, I don't think I have set a
    correct version number.Can you someone give me a sample how to set the buildID.xml and custom.properties? I am a new on the SAP ME5.2
    The Base version is ME_Base_5.2.5.16.5_netweaver-71_Update.zip and
    MEClient_Base_5.2.5.16.5_netweaver-71_Update.zip. the HB customzation
    version is ME_xxxxxx_2.0.0.0.x_netweaver-71.
    Within the sap note 1484551, you mentioned we need change the
    SDKInstallDir/build/buildID.xml file, here is the context of the file:
    buildID.xml -
    <?xml version="1.0" encoding="UTF-8"?>
    <buildID xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <customer>XXXXXX</customer>
    <revision>1.0.0.0</revision>
    <build>1</build>
    </buildID>
    buildID.xml -
    1. how can we change the revision and build?
    There is another file BuildToolDir/build/script/custom.properties, here
    is the file context:
    custom.properties----
    This file contains build properties used to configure the build
    system.
    The name of the software vendor implementing the customizations.
    vendor.name=xxxxxxxxx
    Vendor build identifier. This value is used to uniquely identify
    customizations built by a particular vendor for a particular customer
    and base
    application version.
    This is also used in path locations and in naming certain build
    artifacts, like the custom EJB module and the utility classes archive.
    vendor.id=xxxxxxxxx
    The installation of the J2EE engine installed in the development
    environment.
    ex. C:/usr/sap/CE1\J00
    j2ee.instance.dir=J2EEInstanceDir
    The web context path used to access the main web application. This
    is used by the build to set the
    context-root value in application.xml after an update has been
    imported.
    web.context.path=
    The web context path used to access the production XML interface web
    application. This is used by the build to set the
    context-root value in application.xml after an update has been
    imported.
    xml.context.path=
    The web context path to access resources from the web extension
    application, like images and work instruction HTML files.
    web-ext.context.path=web-ext
    The target database vendor. Valid values are 'oracle' or 'sqlserver'.db.vendor=ORACLE
    The JDBC driver configured for the application server.
    db.drivername=VMJDBC
    JDBC connection propertes for the WIP (Work In Process) database.
    This is the primary application database.
    db.wip.driverclassname=
    db.wip.driver.url=
    db.wip.host=
    db.wip.port=
    db.wip.sid=
    db.wip.user=
    db.wip.password=
    JDBC connection propertes for the ODS (Open Data Store) database.
    This is the offline reporting and archiving database.
    db.ods.driverclassname=
    db.ods.driver.url=
    db.ods.host=
    db.ods.port=
    db.ods.sid=
    db.ods.user=
    db.ods.password=
    Flag indicating whether to add DPMO NC codes to NC idat files when a
    new update is imported. This value is initially
    set by the installer according the the user selection.
    dpmo.nc.codes=
    The default locale used by the production system. The default locale
    is the locale used to display locale
    specific text and messages when the requested locale is not
    available. This property does not need to
    be set if the default locale is english.
    default.locale=en
    Used when running the build from Eclipse to locate the java compiler
    used by the WebLogic EJB compiler.
    jdk.home=C:/Program Files/Java/jdk1.5.0_20
    Compiler debug mode. If set to 'true', debug symbols will be
    compiled into the byte code.
    compile.debug=true
    Keystore alias
    security.alias=xxxxx
    Keystore password
    security.storepass=ChangeIt
    Key password
    security.keypass=ChangeIt
    Keystore type (jks=default,jceks,pkcs12)
    security.storetype=jks
    Optional source control build identifier that is to be displayed with
    standard version information.
    scs.build.ID=
    Optional extended version information to be displayed with standard
    version information.
    ext.info=
    custom.properties----
    2. How can we change this here?
    Regards,
    Leon Lu
    Edited by: Leon Lu on Aug 4, 2011 11:14 AM
    Edited by: Leon Lu on Aug 4, 2011 11:21 AM

    Hi,
    I created one request with logo in the header an page in the footer etc. and called StyleSheet. After you can import this formats by each request.
    You can do this in compound layout.
    Regards,
    Stefan

  • Communication between a driver and application.

    Communication between a driver and application.
    I am writing a driver for a PCI card. I have found very good examples of how the driver should be build.
    Where do I find the information about how the user mode application should be talking the driver.
    So If you have any idea that will help me, please let me know.

    Hi,Sir
    This for your reference.
    It will create pci adapter device node at /devices .
    You can use AP function call ioctl to Communicate with your device driver.
    static int
    xxattach(dev_info_t *dip, ddi_attach_cmd_t cmd)
    int instance = ddi_get_instance(dip);
    switch (cmd) {
    case DDI_ATTACH:
    allocate a state structure and initialize it.
    map the device�s registers.
    add the device driver�s interrupt handler(s).
    initialize any mutexes and condition variables.
    create power manageable components.
    * Create the device�s minor node. Note that the node_type
    * argument is set to DDI_NT_TAPE.
    if (ddi_create_minor_node(dip, "minor_name", S_IFCHR,
    instance, DDI_NT_TAPE, 0) == DDI_FAILURE) {
    free resources allocated so far.
    /* Remove any previously allocated minor nodes */
    ddi_remove_minor_node(dip, NULL);
    return (DDI_FAILURE);
    * Create driver properties like "Size." Use "Size"
    * instead of "size" to ensure the property works
    * for large bytecounts.
    xsp->Size = size of device in bytes;
    maj_number = ddi_driver_major(dip);
    if (ddi_prop_update_int64(makedevice(maj_number, instance),
    dip, "Size", xsp->Size) != DDI_PROP_SUCCESS) {
    cmn_err(CE_CONT, "%s: cannot create Size property\n",
    ddi_get_name(dip));
    free resources allocated so far
    return (DDI_FAILURE);

  • Error on bean:message and resource properties file ??

    Hi everyone! I'm new to struts and i just can't figure out why tomcat's giving me an error. I've manage to run a simple example but when i use the bean:message tag i get this error
    ERROR IS:
    java.lang.NullPointerException
         org.apache.struts.taglib.TagUtils.retrieveMessageResources(TagUtils.java:1175)
         org.apache.struts.taglib.TagUtils.message(TagUtils.java:1038)
         org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:224)
         org.apache.jsp.index_jsp._jspx_meth_bean_message_0(org.apache.jsp.index_jsp:135)
         org.apache.jsp.index_jsp._jspx_meth_html_html_0(org.apache.jsp.index_jsp:101)
         org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:69)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Can anyone help me with this problem?
    my ApplicationResources.propeties file is in WEB-INF/classes
    index.jsp
    <%@ page language="java" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <html:html locale="true">
    <head>
        <title> <bean:message key="index.title"/> </title>
    </head>
    <body>
    <html:link module="/exercise" action="/welcome">Taglib Test Pages</html:link>
    </body>
    </html:html>
    web.xml
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
      "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
      <!-- Action Servlet Configuration -->
      <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <!-- Resources bundle base class -->
        <init-param>
          <param-name>application</param-name>
          <param-value>ApplicationResources</param-value>
        </init-param>
          <!-- Context-relative path to the XML resource containing Struts configuration information -->
        <init-param>
          <param-name>config</param-name>
          <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <!-- The debugging detail level for this servlet, which controls how much information is logged. -->
        <init-param>
         <param-name>debug</param-name>
         <param-value>2</param-value>
        </init-param>
        <init-param>
         <param-name>detail</param-name>
         <param-value>2</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <!-- Action Servlet Mapping -->
      <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
      </servlet-mapping>
    <!-- The Welcome File List -->
      <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
      <!-- Struts Tag Library Descriptors -->
      <taglib>
        <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
        <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
        <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
        <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
      </taglib>
      <!-- Application Tag Library Descriptor -->
      <taglib>
        <taglib-uri>/WEB-INF/app.tld</taglib-uri>
        <taglib-location>/WEB-INF/app.tld</taglib-location>
      </taglib>
    </web-app>Please help..thanks in advance

    I have that on my struts-config.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE struts-config PUBLIC
              "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
              "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
    <struts-config>
      <form-beans>
    </form-beans>
      <global-forwards>
      </global-forwards>
      <action-mappings>
      </action-mappings>
      <message-resources parameter="ApplicationResources"/>
    </struts-config>and I also include it on my web.xml file
    <!-- Resources bundle base class -->
        <init-param>
          <param-name>application</param-name>
          <param-value>ApplicationResources</param-value>
        </init-param>

  • Application Properties file

    Hi,
    I have a java DC which should be able to read some application properties like
    mdm.servername
    mdm.repositoryname
    mdm.username
    I have tried using the ApplicationConfigHandler class in which I created a EAR and Web Module DC and when I run this web module dc as standalone, the properties file "sap.application.global.properties" gets loaded successfully.
    But when I call this webmodule Dc's method to load properties from a Java DC , all the properties are null.
    Is there any other way that I can load properties in java DC which can be modified without having to redeploy the java dc.
    Thanks
    MLS

    Hi
    Use [configuration services |https://help.sap.com/saphelp_nw04/helpdata/en/b8/aa343e32ff1033e10000000a114084/frameset.htm] in order to created application-specific properties that can be modified at run-time.
    Good luck,
    Ola

  • Struts and JSF Integration in OPDk-java based portlet

    Hi,
    thanks in advance for your help.
    I'm developing a PDK java based portlet. For some reasons I cannot use the JSF bridge but I would like to integrate Struts and Jsf in my portlet, using Struts to manage actions and navigation and JSF (with ADF Faces components) for the view. I'm using the Strus-Faces library.
    When I try to submit my portlet form, I receive the error "request URL not found on this server". I'm posting some exstracts of my code.
    It's made of three pages: the main one "Integration1ShowPage", "error" and "result". The MainAction.java displays my mainPage, where there's a form. To keep it easy, when the user submits this form, the ActionName returns "success" and the "result" page should be displayed.
    The MainAction works properly: the portlet is displayed but when I tried to submit the form I receive
    The requested URL /provaDeploy/htdocs/integration1/integration1ShowPage.do was not found on this server.Could you please suggest me something?
    Many many thanks,
    B.
    <struts-config>
    <action-mappings>
      <action path = "/mainAction" type = "strutsjsfintegration1.MainAction">
        <forward name = "success" path = "/faces/htdocs/integration1/integration1ShowPage.faces"/>
      </action>
      <action path = "/nameAction" name = "nameForm"
      input = "/faces/htdocs/integration1/integration1ShowPage.faces" scope = "request"
      type = "strutsjsfintegration1.NameAction">
        <forward name = "success" path = "/faces/htdocs/integration1/result.faces"/>
        <forward name = "failure" path = "/faces/htdocs/integration1/error.faces"/>
        <forward name = "again" path = "faces/htdocs/integration1/integration1ShowPage.faces"/>
      </action>
    </action-mappings>
    <controller>
      <set-property property = "processorClass"
       value="org.apache.struts.faces.application.FacesRequestProcessor"/>
       </controller>
    <message-resources parameter="definitiveStrutsPortlet.ApplicationResources"/>
    </struts-config>

    Hi,
    have a look at this whitepaper for how to use JavaScript in ADF.
    http://www.oracle.com/technetwork/developer-tools/jdev/1-2011-javascript-302460.pdf
    This link here (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html --> see sample 71) shows an integration sample between a Java Applet and ADF. Its a similar use case to yours
    Frank

  • Can Struts and JSF coexist?

    I have a Struts based application and now I want to build an additional module on top of that using pure JSF. My question is, can Struts and JSF co-exist in the same application? If yes, what are the cons of that approach? What are the places I need to tweak in the configuration files so that they work together?
    thanks,

    Hi,
    Yes they can coexist. Actually that's the approach recommended by Craig McClanahan. I have developed a full enterprise application (80% completed) which uses JSF in front and Struts in the back using Struts-Faces integration library (developed by Apache).
    So far I haven't faced any major issues with this approach. However, I haven't try using Struts validator on JSF objects.
    Read the article below on how to integrate JSF w/ Struts.
    http://www.oracle.com/technology/pub/articles/masterj2ee/j2ee_wk8.html

  • Problems when using shared instances of struts and apache-commons?

    I found this worrisome statement on this page (http://struts.apache.org/1.3.8/userGuide/configuration.html) regarding sharing jar files across multiple applications:
    <i>When a class is loaded from a shared class loader, static variables used within that class become global as well. This can cause inter-webapp conflicts when the underlying code assumes that the statics are global only within a particular web applicaiton (which would be true if the class was loaded from the webapp class loader). There are many cases where the framework, and the Commons libraries it relies on, use static variables to maintain information that is presumed to be visible only within a single web application. <b>Sharing these JAR files can cause unwanted interactions, and probably cause incorrect behavior</b>.</i>
    For those of you currently using Struts and Apache Commons (and perhaps other open source libraries) have you run into any issues when sharing the jars amongst multiple applications?
    I would like to avoid having multiple applications loading their own copies of these libraries, for obvious reasons.  However, if there are issues with doing so, I may have to relax that position.

    To answer my own questions, while we didn't run into any issues with sharing Struts, it may be a good idea to incorporate the libraries directly into the web app if suspicious behaviour is observed by the application.
    Also, the taglib definitions could not be loaded from the referenced jar files - these had to be placed into the WEB-INF directory, which introduces a synchronization problem - you could conceivably have different versions of the tld's and the base libraries.

Maybe you are looking for

  • Time Capsule user account

    I use Lion OSX I have created 2 user accounts on my time capsule in order to backup 2 different macs in the respective user's directories. When i try to restore one of my mac from scratch using "Restore System from Backup", inserting user account and

  • Display a .swf file in the Gallery example

    Is it possible to display a .swf file instead of a .jpeg in the Gallery example? Any help would be appreciated.

  • Webservices as datasource in OBIEE

    How can we use Webservices as a datasource at RPD level in OBIEE?

  • Separation color space - get alternate color (function of type 0)

    Hello, I'm trying to retrieve the alternate color value of a spot color which has a function of type 0. Actually I just want to retrieve the result of the function when the tint is 1.0. How can I do that? Thanks in advance, Joe

  • Refresh or Reload Issue with Multiple Blcoks in the One View

    Hi All We have one view which consists of multiple blocks say multiple UI container elements. Each container contains different UI elements and business logics. For example: Having Container 1 and Container 2. If we are doing any action in Container2