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

struts "index.title"

 
Peter Tilm
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
i'm new to the topic of servlets/web-applications. I just compiled the struts-example with eclipse (successfully). But if i install the WAR-file in tomcat and click the link of the struts-example i receive the following error message:
javax.servlet.jsp.JspException: Missing message for key "index.title"
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:297)
org.apache.jsp.index_jsp._jspx_meth_bean_message_0(index_jsp.java:163)
org.apache.jsp.index_jsp._jspx_meth_html_html_0(index_jsp.java:105)
org.apache.jsp.index_jsp._jspService(index_jsp.java:76)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
----------------------------------
anyone a clue?
thanks
Peter
 
Anand Ko
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Struts display is done through JSP. I think in JSP, standard bean tld(tag library descriptors) is used.
Eg: Display some text corresponding to this key (index.title).
<bean:message key="index.title"/>
So, this tag is expecting the value for this key "index.title".
So just check the key (index.title) in resource bundle provided in the war.
Hope i am right?
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey folks -
I'm moving this to our Frameworks forum where theres lots of other Struts questions. So please continue the conversation there. Thanks!
 
Eric Fletcher
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Anand Koppal:
In Struts display is done through JSP. I think in JSP, standard bean tld(tag library descriptors) is used.
Eg: Display some text corresponding to this key (index.title).
<bean:message key="index.title"/>
So, this tag is expecting the value for this key "index.title".
So just check the key (index.title) in resource bundle provided in the war.
Hope i am right?

Yep, you are right. You need a property defined in your resource bundle called "index.title", something like:
index.title=Page Title
Cheers,
E
 
Peter Tilm
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there's already a index.title defined. index.title=MailReader Demonstration Application (Struts 1.1-dev)
it's located in ApplicationResources.properties. Is it the right place to define it or where do i have to define index.title?
thanks,
Pete
 
Calvin Yan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Peter,
Did you config the path of properties file correctly? It should be expressed in struts-config.xml file, message-resource node.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic