Solved

why my jsp value not coming to Action class ?

Posted on 2010-08-26
9
615 Views
Last Modified: 2013-11-23
Hi ,

I have 2 jsp and tha will have corresponding Action class

one jsp text box and other thing dropdown value are iam getting(request.getParameter) in Action class (with out passing to query string)

but in another JSp i cant y ??
i cant find out that can you help me ??

For your references i attach my JSP ?

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<fmt:setBundle basename="ApplicationResources"/>

<%@ taglib uri="/WEB-INF/displaytag-11.tld" prefix="display" %>

<%@ page language="java" contentType="text/html; charset=UTF-8"

	pageEncoding="UTF-8"%>

	<%@ page import="java.util.ArrayList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/bioOrigin.css">

<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/ddtabmenufiles/ddcolortabs.css" />

<script type="text/javascript" src="<%=request.getContextPath() %>/ddtabmenufiles/ddtabmenu.js"></script>

<script type="text/javascript">

//SYNTAX: ddtabmenu.definemenu("tab_menu_id", integer OR "auto")

ddtabmenu.definemenu("ddtabs4",2);



</script>



<title>¿¿¿¿¿¿¿¿</title>

<script type="text/javascript">



function nonyusakiSearch()

{

	var returnVal=true;

	var nonusakiName=document.nonusakiSearch.nonusakiName.value;

	var window =document.nonusakiSearch.window.value;

    var fliter=document.nonusakiSearch.fliter.value;

    var tabFilter=document.nonusakiSearch.tabFilter.value;

	if(nonusakiName=="")

	{

     alert("please enter some value for search");

     document.nonusakiSearch.nonusakiName.focus();

     returnVal =false;

	}



    if(tabFilter=="select")

	{

     alert("please select some ¿¿¿¿¿");

     document.nonusakiSearch.nonusakiName.focus();

     returnVal =false;

	}

 if(returnVal==true)

  {

	  

	location.href = '<%=request.getContextPath() %>/nonyusakiSearch.do?action=searchButton'; 

  }

  return returnVal;



}

function gotoCheck(i,y)

{



var check =parseInt(i)+1;

	var x=document.getElementById("processTable").rows[check].cells;

	var window =parseInt(document.shohinCodeSearch.window.value);

	opener.document.getElementById("shohinName"+window).innerHTML=x[1].innerHTML;

	opener.document.manualForm.shohinCode[window].value=y;

	self.close();

}



</script>

<body>





<form name="nonusakiSearch" id="nonusakiSearch" action="#" method="post">

<input type="hidden" name="window" id="window" value="<%=request.getAttribute("window") %>"></input>

<input type="hidden" name="str" id="str" value=""></input>

           <table align="left" width="100%" >

              	<tr>

              	  <td>

              	  <table class="bFF">

              	    <tr>

				      <td  > <bean:message key="labael.manualInput.nonusakiSearch.searchTitle" />  </td>

				      <td ></td>

				      <td > </td>

				    </tr>

				  </table>

				  </td>

				  </tr><tr>

				  <td>

				   <table>

				     <tr>

				       <td width ="40%"></td>

				       <td width ="40%"></td>

					   <td align="right" width ="40%"><input type="button" name="btnSubmitProceed" value="<bean:message key="labael.manualInput.nonusakiSearch.searchButton" />"

					           onclick="nonyusakiSearch();"></input>  </td>

				     </tr>

				   

				   </table>

				 </td>

				</tr>

				<tr>

				   <td>

				     <table class="bff3">	

				     <tr >

							 <td width="18%"> <bean:message key="labael.manualInput.nonusakiSearch.searchCondition1" />

							      (<bean:message key="labael.manualInput.nonusakiSearch.searchCondition1" />) 

						    </td>

						    <td> <input type="text" name="nonusakiName" id="nonusakiName" > </td>

						    <td> </td>

						    <td> </td>

						    <td > <bean:message key="labael.manualInput.nonusakiSearch.searchFilter"/> </td>

						    

						     <td >  <%

                ArrayList	filterList = (ArrayList)request.getAttribute("filterList");

                if (filterList != null && filterList.size() > 0){

                  out.println("<CENTER>");

                  %>

                  <select name="fliter"  id="fliter">

                    <option value="select"><bean:message

							key="select.wholesaler.sumcosinder.falg" /></option>

                    <%

                    for (int i=0;i<filterList.size();i++) {



                      out.println("<option value='"+i + "'");

                                    out.println(">"+ filterList.get(i) + "</option>");

                    }

                    %>

                  </select>

                  <%

                  out.println("</CENTER>");



                }

                %>

 </td>

				    </tr>

				    <tr>

							<td> <bean:message key="labael.manualInput.nonusakiSearch.searchTable" /></td>

							<td> <select  name="tabFilter" id="tabFilter"  >

							    <option value="select"><bean:message key="select.wholesaler.sumcosinder.falg" /></option>

								<option  value="1">¿¿</option>

								<option value="2">¿¿¿</option>

									

								</select> </td>

				   </tr>

			     </table>

               </td> 

			</tr>

			</table>

	      

			

      <br></br>

    

    <c:if test="<%= request.getAttribute("nonusakiNameList") != null &&    

	((ArrayList)request.getAttribute("nonusakiNameList")).size() > 0 %>" >

      <% int i =0; %>

       <display:table  name="nonusakiNameList" pagesize="20"  align="center" cellpadding="5" class="data" requestURI="/nonyusakiSearch.do"  id="processTable" width="100%" >

              <display:column    title="¿¿¿¿¿¿" align="center">

               <a href="javascript:gotoCheck('<%=i %>','${processTable.tkuiskCD}')" >${processTable.tkuiskCD }</a>

         

               </display:column>

            <display:column property="tkuiskrykNMJ" title="¿¿¿¿¿" align="center" />

            <display:column property="tkuskNMk" title="¿¿¿¿(¿¿)" align="center" />

            <display:column property="zyusyoNMK" title="¿¿(¿¿)" align="center" />

            <display:column property="daihyotelNO" title="¿¿¿¿¿¿" align="center" />

            <display:column property="tkyoukaisYMD" title="  ¿¿

                                                                                                               ¿¿¿¿¿" align="center" />

            <display:column property="skzyFLG" title="¿¿" align="center" />

            

                        <%=i++ %>

       </display:table>

 </c:if>



</form>

</body>

</html>

Open in new window

0
Comment
  • 5
  • 3
9 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 33535580
did you set the formbean to session object (with the same name as mentioned in struts-config.xml) in action class?
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 33535716
session object means ??
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 33535734
I mention in struts-Config.xml
but i didnt get the point formbean to session object ?
Can you tell me how can i do that ??
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 33535812
i was referring to HttpSession which is retrieved from HttpRequest object.
But it is not required,
just check if you have followed these steps(5 steps are mentioned)
http://www.jguru.com/faq/view.jsp?EID=1071584
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 33536047
Nothing happen ?????  :(
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 33537007
Is there any update ??
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 33538951
Sorry for delayed response, it was quite late for me
please check these links
http://www.roseindia.net/struts/strutsActionForms.shtml
http://www.ibm.com/developerworks/web/library/wa-struts/  (3rd point of best practice)

Also please share the jsp code and action class code with me
0
 
LVL 2

Expert Comment

by:jzkidding
ID: 33539375
please check whether you are pointing to the same action class in the JSP.Since the other JSP file works,I .
think there is a minor change required

Or compare with both the JSps ... hope fully you might find the missing link
0
 
LVL 20

Accepted Solution

by:
Sathish David  Kumar N earned 0 total points
ID: 33576799
i am submiting the form
 
location.href = '<%=request.getContextPath() %>/nonyusakiSearch.do?action=searchButton';
so that only pblm after i change that its work fine  
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
backtracking recursion  code 19 54
simple java question 3 44
Java DateChooser? 3 29
diffSum example 4 27
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now