Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem reading from properties file in struts 2

 
Subhash Shah
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to struts 2.
I have 2 jsp files. e.g. 1.jsp and 2.jsp

2.jsp has a frameset and one frame has 1.jsp as source.

I want to use a label in 1.jsp. but I get an error when I try to include <s:label key="msg" /> (msg is in test.properties file)

I have following configuration in web.xml file.

<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
<init-param>
<param-name>actionPackages</param-name>
<param-value>com.foo.action.common</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>

I found that the problem is due to 1.jsp is not called through FilterDispatcher.

Does anyone have any idea about how to resolve the issue?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes--don't access JSP pages directly.
 
Subhash Shah
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic