0 Replies Latest reply on Sep 23, 2002 12:24 PM by mkithany

    Simple Bean not working

    mkithany

      Hi JBosses and Mr. Juha,

      As you mentioned, I tried to use package for my beans/servlets. My modified directory structure is :

      /kithany (root)
      /kithany/register.html
      /kithany/success.jsp
      /kithany/retry.jsp
      /kithany/process.jsp (bean)
      /kithany/WEB-INF/web.xml
      /kithany/WEB-INF/classes/mybean/FormBean.java (package mybean)
      /kithany/WEB-INF/classes/mybean/FormBean.class (package mybean)
      /kithany/WEB-INF/classes/mybean/forms.properties
      /kithany/WEB-INF/classes/forms.properties
      /kithany/META-INF/application.xml

      Then, I create the kithany.war file as shown below:

      #cd /kithany
      #jar -cvfM kithany.war .

      I then put the "kithany.war" file in /jboss/server/default/deploy directory
      and In your browser type:

      http://IP_ADDR_ESS:8080/kithany/register.html

      which works fine. In my "register.html" file my action is <form action="/kithany/process.jsp" method=post>
      When I click the SUBMIT button in "register.html" form (which then calls bean and servelte), I get following Error - wonder why.

      ------------------------------------------------------------------------------------
      Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error - that
      prevented it from fulfilling this request

      java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key /kithany/retry.jsp
      at java.util.ResourceBundle.getObject(ResourceBundle.java(Compiled Code))
      at java.util.ResourceBundle.getString(ResourceBundle.java(Compiled Code))
      at org.apache.jsp.process$jsp._jspService(process$jsp.java:142)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java
      --------------------------------------------------------------------------

      My process.jsp file is:
      ------------------------------------------------------------------------------------
      <%@ page import="java.util.*, mybean.*" %>

      <%!
      ResourceBundle bundle =null;
      public void jspInit() {
      bundle = ResourceBundle.getBundle("forms");
      }
      %>

      <jsp:useBean id="formHandler" class="mybean.FormBean" scope="request">
      <jsp:setProperty name="formHandler" property="*"/>
      </jsp:useBean>

      <%
      if (formHandler.validate()) {
      %>
      <jsp:forward page="<%=bundle.getString(\"/kithany/process.success\")%>"/>
      <%
      } else {
      %>
      <jsp:forward page="<%=bundle.getString(\"/kithany/process.retry\")%>"/>
      <%
      }
      %>
      ------------------------------------------------------------------------------------

      I would really appreciate if any of you Experts could put some light onto this error.

      THANKS!

      Manoj G. Kithany