ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From satya_08 <sb.majum...@rediffmail.com>
Subject iBATIS+Sprites problem !!!!!
Date Wed, 06 Feb 2008 09:58:06 GMT

Hi all , I am a beginer in iBATIS and sprites .

I am trying to develop a small web application ,

Here is the structure of my app------------->
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\TestStripes
There is a jsp file , 
under C:\Program Files\Apache Software Foundation\Tomcat
5.5\webapps\TestStripes directory .

The content of the jsp is 
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="stripes"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      <title>LOGIN PAGE</title>
      <style type="text/css">
          input.error { background-color: yellow; }
                              <h1>UserID and LOGIN</h1>

    <stripes:form action="/user_validation/UserPass.action" focus="">
                <td>User ID:</td>
                <td><stripes:text name="user_id"/></td>
                <td><stripes:password name="password"/></td>
                <td colspan="2">
                    <stripes:submit name="submit_action" value="submit"/>

Under WEB-INF , there are two sub directory 
   Under lib I have included all the necessary jars , such as
& stripes.jar

  Under classes directory there is my UserPassActionBean.java file and
SqlMapConfig.xml and SqlMap.xml files   

The UserPassActionBean.java  is ----------->

   package net.sourceforge.stripes.user_validation;

   import net.sourceforge.stripes.action.ActionBean;
   import net.sourceforge.stripes.action.ActionBeanContext;
   import net.sourceforge.stripes.action.DefaultHandler;
   import net.sourceforge.stripes.action.Resolution;
   import net.sourceforge.stripes.action.StreamingResolution;
 //  import net.sourceforge.stripes.validation.Validatable;
   import net.sourceforge.stripes.validation.ValidationError;
   import net.sourceforge.stripes.validation.ValidationErrorHandler;
   import net.sourceforge.stripes.validation.ValidationErrors;
   import net.sourceforge.stripes.action.ForwardResolution;
   import com.ibatis.sqlmap.client.*;
   import com.ibatis.common.resources.Resources;
   import com.ibatis.common.logging.*;

   import java.io.StringReader;
   import java.util.List;
   import java.io.*;
   import java.util.*;

   public class UserPassActionBean implements ActionBean,
              private ActionBeanContext context;
             /* @Validate(required=true) */private String user_id;
            /*  @Validate(required=true) */private String password;
                                           private String result;

              public ActionBeanContext getContext() { return context; }
              public void setContext(ActionBeanContext context) {
this.context = context; }

              public Resolution handleValidationErrors(ValidationErrors
errors) throws Exception
                       StringBuilder message = new StringBuilder();
                       for (List<ValidationError> fieldErrors :
                             for (ValidationError error : fieldErrors)
                                message.append("<div style=\"color:
                       return new StreamingResolution("text/html", new
              /** Handles the 'submit' event, check the validation  and
returns the result. */
          /*    @DefaultHandler public Resolution submit()
                  String result = String.valueOf(user_id + password);
                  return new StreamingResolution("text", new
              } */

              // Standard getter and setter methods
              public String getUser_id() { return user_id; }
              public void setUser_id(String user_id) { this.user_id =
user_id; }

              public String getPassword() { return password; }
              public void setPassword(String password) { this.password =
password; }
              public String getResult() { return result; }
              public void setResult(String result) { this.result = result; }

              /** An event handler method that adds number one to number
two. */
              public Resolution submit()
                       String resources = "SqlMapConfig.xml";
                       Reader reader =
                       SqlMapClient sqlMapper =
                       Map m = new HashMap(1);
                       password =
                       result = user_id + password;
                  catch(IOException ex)
                      // System.out.println(ex.getMessage());
                  catch(Exception ex)
                     // System.out.println(ex.getMessage());
                   return new ForwardResolution("/index.jsp");

The content of the sqlMap.xml is 
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap      
    PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"      

<parameterMap id="pm_out_example" class="java.util.Map">
   <parameter property="a" mode="IN" />
<procedure id="out_example" parameterMap="pm_out_example"
{call usp_sel_ggl_users_passwd(?)}


& the content of the SqlMapConfig.xml is 
<?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE sqlMapConfig
      PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"


      <!-- Statement namespaces are required for Abator -->
      <settings useStatementNamespaces="true" />

      <!-- Setup the transaction manager and data source that are
          appropriate for your environment-->
      <transactionManager type="JDBC">
          <dataSource type="SIMPLE">

              <property name="JDBC.Driver" value="com.mysql.jdbc.Driver" />
              <property name="JDBC.ConnectionURL"
value="jdbc:mysql://" />

              <property name="JDBC.Username" value="root" />
              <property name="JDBC.Password" value="sql123" />

      <!-- SQL Map XML files should be listed here -->
      <sqlMap resource="SqlMap.xml" />



Now when I upload my entire application into web & when I am invoking the
jsp its ok , but when I give some values into the text field , & pressing
the submit button the jsp does not give any output .

Please help me out from this problem 


View this message in context: http://www.nabble.com/iBATIS%2BSprites-problem-%21%21%21%21%21-tp15306350p15306350.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

View raw message