hi all, i am new to struts and i have developed my application something like this.
i have a login page named Login.jsp, which has a corresponding ActionForm and Action Class, the web.xml and struts-config.xml are also there in addition to the Application Resources.properties file. the application properties file and the .java files are in a package called mystrutspack.
out.println("The Firstname entered by you is "+request.getAttribute("myempfname")+"."+"\\n"); out.println("\nThe Lastname entered by you is "+request.getAttribute("myemplname")+"."+"\n"); out.println("\nThe Department entered by you is "+request.getAttribute("myempdept")+"."+"\n"); }
# Resources for parameter 'strutspack.ApplicationResources' # Project P/TryStrutsProject loginpage.empfirstname= Employee's First Name loginpage.emplastname=Enter Employee's Last Name loginpage.empdepartment=Enter Employee's Depatment
i am using eclipse 3.1 and the applicationresources.properties file exists in the /src/strutspack directory.
Joined: Feb 15, 2005
It's fine to put a copy of the properties file in the source directory, but Struts will not read it from there. It must be copied to your WEB-INF/classes directory along will all your java class files. I believe that Eclipse will automatically copy properties files from the source directory to the binaries directory, but you need to verify this. Make sure that the file exists in WEB-INF/classes/strutspack.
if you are using weblogic8.1 you may use this alternative.
As said by others it should be some problem that your properties file is not loaded in classes folder.recheck your .war file or your files.
but alternately you may use <i18> tag only if you are using weblogic8.1 version. <% String language = "en_us"; %> <i18n:localize language="<%=language%>" bundleName="Messages"/> <html> <body> <i18n:getMessage messageName="greeting"/> </body> </html>