Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to read through property file

 
carox kaur
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I new to stuts. I have started with struts1.1. I have tried making an internationalized application. But the application is not working. I am trying to make a website which on the basis of the language code in the request parameter, picks the right ApplicationResources file and shows the contents on the jsp pages. After deploying the application, on doing
http://localhost:7001/international
index.jsp is not found. whereas it exists in the webRoot. I am not able to detect where the error lies.

Index.jsp

welcome.jsp- Only the body part I am showing.

Web.xml


Struts-config. xml


The path where the property files are - international\WebRoot\WEB-INF\classes\com\yourcompany\struts\. International is my application directory.
ApplicationResources_en.properties


ApplicationResources_hi.properties


In Action class- MyAction.java, In the execute () I have just written;

The string/key success maps to welcome.jsp.

Carox.

 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
carox kaur wrote:Hi, I new to stuts. I have started with struts1.1.

Why 1.1, why don't you start with the latest build version, which is 1.3.9.
carox kaur wrote:http://localhost:7001/international
index.jsp is not found. whereas it exists in the webRoot. I am not able to detect where the error lies.

We don't know how is your war file directory strutcure is, ideally the index.jsp should be in

APP_NAME/index.jsp
APP_NAME/WEb-INF/classes
APP_NAME/WEb-INF/lib
APP_NAME/WEb-INF/web.xml, struts-config.xml, and other xml


OR paste the full path of you "index.jsp" file.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic