Values on the jsp page not loading after refresh
Hi All,
I have a problem in getting the values back onto the jsp page after a refresh. After the first refresh i get null values.
Let me know what i should use: is it 1. request 2. application or 3. session scope? I have to keep my application running for ever (as long as the server is running) refreshing every 3 minutes. So i used application scope but in vain.
Also i am using requestDispatcher and forwarding the req,res. I came to know that this method has some problems if we use request attributes. Do i need to use a send.Redirect instead?
Let me know the correct procedure.
Thanks in advance.
Gouri-Java wrote:
Hi All,
I have a problem in getting the values back onto the jsp page after a refresh. After the first refresh i get null values.
Let me know what i should use: is it 1. request 2. application or 3. session scope? I have to keep my application running for ever (as long as the server is running) refreshing every 3 minutes. So i used application scope but in vain.
Also i am using requestDispatcher and forwarding the req,res. I came to know that this method has some problems if we use request attributes. Do i need to use a send.Redirect instead?
Let me know the correct procedure.
Thanks in advance.r u forwarding request to same page. ?
try using sendRedirect with URL rewriting:
for eg .
response.sendRedirect("/myPage.jsp?id="+idValue+"");
and access id on page submit.
as
request.getParameter("id");
This should work .
Edited by: AmitChalwade123456 on Jan 6, 2009 7:10 AM
Similar Messages
-
Passing values to the JSP page - Urgent
Hi all,
I have to pass the user id value to the JSP page. I have written the following code in the doInitialization() method
IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
IPortalComponentContext myContext = request.getComponentContext();
IPortalComponentProfile myProfile = myContext.getProfile();
IAuthentication ia = UMFactory.getAuthenticator();
IUser portalUser = ia.getLoggedInUser(request.getServletRequest(), request.getServletResponse(false) );
s = portalUser.getUniqueName();
IPortalComponentSession componentSession = ((IPortalComponentRequest)getRequest()).getComponentSession();
Object o = componentSession.getValue("myEvents");
myEvents = (LoadEvents)o;
//myEvents = (LoadEvents) myContext.getValue("myEvents");
myEvents.setUserId(s);
myContext.putValue("myBeanName", myEvents);
I have also defined myEvents as a bean in my JSP page with scope APPLICATION. But I get User Id as "NULL".
Thanks in advance.
Rgds,
Janvi.Hi Prakash,
Please find the jsp code pasted below:
<hbj:content
id="myContext">
<hbj:page
title="Successful processing">
<jsp:useBean id="myMeet" scope="application" class="com.sap.ep.bluestar.LoadEvents" />
<jsp:useBean id="myEvents" class="com.sap.ep.bluestar.MonthView" scope="application" />
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" %>
<%
int leadSpaces, daysInMonth, leadSpaces_next,daysInMonth_next, col_Counter;
myCal.setMonthView();
java.util.Vector printVal_pre = new java.util.Vector();
myCal.printMonth(myCal.getPre_month(),myCal.getPre_year());
printVal_pre = myCal.getPrintValues();
java.util.Vector printVal_cur = new java.util.Vector();
myCal.printMonth(myCal.getCur_month(),myCal.getCur_year());
printVal_cur = myCal.getPrintValues();
java.util.Vector printVal_next = new java.util.Vector();
myCal.printMonth(myCal.getNext_month(),myCal.getNext_year());
printVal_next = myCal.getPrintValues();
if(request.getMethod().equals("POST")){
try {
String action =(String) request.getParameter("action");
if(action.equals("insert")){
// response.sendRedirect("_insertEvent.jsp");
//response.sendRedirect("test.html");
} catch(Exception e) {
System.out.println(e.getMessage());
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="javascript">
function insertEvent(frm,eventDay){
alert("here finally " + eventDay + " " + frm.eventMonth.value + " " + frm.eventYear.value );
frm.action.value = "insert";
frm.submit();
function openWin(frm,eventDay)
var newWin = window.open("http://localhost:50100/irj/servlet/prt/portal/prtroot/Web_Calendar.eventHandler?variable=" + frm.eventMonth.value + "/" + eventDay + "/" + frm.eventYear.value, 'popup',
'resizable,height=200,width=325');
if(newWin.focus) newWin.focus();
</script>
</head>
<body>
User is : <%= myCal.getUserId() %>
<table width="745" height="583" border="0">
<tr>
<td width="258" height="23" align="center"><B> <% out.println(printVal_pre.elementAt(0).toString() + " " + printVal_pre.elementAt(1).toString());
leadSpaces = ((Integer)printVal_pre.elementAt(2)).intValue();
daysInMonth = ((Integer)printVal_pre.elementAt(3)).intValue();
%> </B> </td>
<td width="215"> </td>
<td width="258" align="center"><B> <% out.println(printVal_next.elementAt(0).toString() + " " + printVal_next.elementAt(1).toString());
leadSpaces_next = ((Integer)printVal_next.elementAt(2)).intValue();
daysInMonth_next = ((Integer)printVal_next.elementAt(3)).intValue();
%> </B></td>
</tr>
<tr>
<td height="151"><table width="245" border="1">
<tr>
<th width="35" scope="col"><div align="center">S</div></th>
<th width="35" scope="col"><div align="center">M</div></th>
<th width="35" scope="col"><div align="center">T</div></th>
<th width="35" scope="col"><div align="center">W</div></th>
<th width="35" scope="col"><div align="center">T</div></th>
<th width="35" scope="col"><div align="center">F</div></th>
<th width="35" scope="col"><div align="center">S</div></th>
</tr><tr>
<% col_Counter = 0;
for (int i = 0; i < leadSpaces; i++) {
out.print("<td> </td>");
col_Counter++;
for (int i = 1; i <= daysInMonth; i++) {
// This "if" statement is simpler than messing with NumberFormat
if(i < 9) {
out.print("<td align='center'>" + " " + i + "</td>");
col_Counter++;
} else {
out.print("<td align='center'>" + i + "</td>");
col_Counter++;
if ((leadSpaces + i) % 7 == 0) { // Wrap if EOL
out.println("</tr><tr>");
int cnt = col_Counter;
if(col_Counter == 28){
out.println("</tr>");
}else {
for(int i = 0; i < (42 - col_Counter);i++){
out.print("<td> </td>");
cnt++;
if((cnt%7) ==0)
out.println("</tr><tr>");
out.println("</tr>");
%>
</table></td>
<td> </td>
<td><table width="245" border="1">
<tr>
<th width="35" scope="col"><div align="center">S</div></th>
<th width="35" scope="col"><div align="center">M</div></th>
<th width="35" scope="col"><div align="center">T</div></th>
<th width="35" scope="col"><div align="center">W</div></th>
<th width="35" scope="col"><div align="center">T</div></th>
<th width="35" scope="col"><div align="center">F</div></th>
<th width="35" scope="col"><div align="center">S</div></th>
</tr>
<tr>
<% col_Counter = 0;
for (int i = 0; i < leadSpaces_next; i++) {
out.print("<td> </td>");
col_Counter++;
for (int i = 1; i <= daysInMonth_next; i++) {
// This "if" statement is simpler than messing with NumberFormat
if(i < 9) {
out.print("<td align='center'>" + " " + i + "</td>");
col_Counter++;
} else {
out.print("<td align='center'>" + i + "</td>");
col_Counter++;
if ((leadSpaces_next + i) % 7 == 0) { // Wrap if EOL
out.println("</tr><tr>");
cnt = col_Counter;
if(col_Counter == 28){
out.println("</tr>");
}else {
for(int i = 0; i < (42 - col_Counter);i++){
out.print("<td> </td>");
cnt++;
if((cnt % 7 ) ==0)
out.println("</tr><tr>");
out.println("</tr>");
%>
</table></td>
</tr>
<tr>
<td colspan="3"><table width="735" height="383" border="1">
<tr>
<td colspan="7" align="center"><B> <% out.println(printVal_cur.elementAt(0).toString() + " " + printVal_cur.elementAt(1).toString());
leadSpaces = ((Integer)printVal_cur.elementAt(2)).intValue();
daysInMonth = ((Integer)printVal_cur.elementAt(3)).intValue();
%> </B></td>
</tr>
<tr>
<th width="105" scope="col">SUN</th>
<th width="105" scope="col">MON</th>
<th width="105" scope="col">TUE</th>
<th width="105" scope="col">WED</th>
<th width="105" scope="col">THUR</th>
<th width="105" scope="col">FRI</th>
<th width="105" scope="col">SAT</th>
</tr>
<form name="eventCal" method="post" action="Web_Cal.jsp">
<input name="eventMonth" type="hidden" value="<%= myCal.getCur_month() + 1 %>">
<input name="eventYear" type="hidden" value="<%=myCal.getCur_year() %>">
<input name="action" type="hidden" value="">
<tr>
<% col_Counter = 0;
for (int i = 0; i < leadSpaces; i++) {
out.print("<td> </td>");
col_Counter++;
for (int i = 1; i <= daysInMonth; i++) {
// This "if" statement is simpler than messing with NumberFormat
if(i < 9) {
out.print("<td align='center'>" + " " + "<a href='javascript:openWin(document.eventCal," + i + ");'>" + i + "</a></td>");
col_Counter++;
} else {
out.print("<td align='center'>" + "<a href='javascript:openWin(document.eventCal," + i + ");'>" + i + "</a></td>");
col_Counter++;
if ((leadSpaces + i) % 7 == 0) { // Wrap if EOL
out.println("</tr><tr>");
if(col_Counter == 28){
out.println("</tr>");
}else if(col_Counter < 35){
for(int i = 0; i < (35 - col_Counter);i++)
out.print("<td> </td>");
out.println("</tr>");
}else {
for(int i = 0; i < (42 - col_Counter);i++)
out.print("<td> </td>");
out.println("</tr>");
%> </form>
</table></td>
</tr>
</table>
</body>
</html>
</hbj:textView>
</hbj:page>
</hbj:content>
Regards,
Janvi -
Could not invoke the service() method when the JSP page is loaded
I am new to servlets/jsp so excuse if I am doing something silly here:
I have a JSP page the suppose to be loading a session attrbute from a simple servlet. When I go to load the jsp page, I get Could not invoke the service() method.
Any help is much appreciated:
Here is my JSP:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page session="true" import="insurance.PolicyObj,java.util.*"%>
<% Vector VTable = (Vector) session.getAttribute("policyTable"); %>
<HTML>
<BODY>
<Form name=listTable action="InsSer" method="post">
<TABLE border="1">
<TBODY>
<TR>
<TD width="258" align="center"><B>Policy Id</B></TD>
<TD width="187" align="center"><B>Customer Name</B></TD>
<TD width="160" align="center"><B>Agent Name</B></TD>
<TD width="134" align="center"><B>Status</B></TD>
</TR>
<TR>
<%
for (int index=0; index < VTable.size();index++) {
PolicyObj TableL = (PolicyObj) VTable.elementAt(index);
%>
<TR bgcolor="#99CCFF">
<TD width="258" align="center"> <%= TableL.getPolicyId()%> </TD>
<TD width="187" align="center"> <%= TableL.getCustomerName()%> </TD>
<TD width="187" align="center"> <%= TableL.getAgentName() %> </TD>
<TD width="187" align="center"> <%= TableL.getPolicyStatus() %></TD>
</TR>
<% } %>
</TBODY>
</TABLE>
<P><INPUT type="submit" name="Submit" value="Refresh Active Policies"></P>
</BODY>
</HTML>
Here is my servlet:
package insurance;
import java.io.IOException;
import java.util.Vector;
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class InsSer extends HttpServlet implements Servlet {
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#HttpServlet()
public InsSer() {
super();
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest arg0, HttpServletResponse resp)
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doPost(req,resp);
// TODO Auto-generated method stub
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest arg0, HttpServletResponse resp)
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//PolicyObj[] policyTable = new PolicyObj[3];
HttpSession session = req.getSession(false);
//if (session == null) {
//resp.sendRedirect("http://localhost:9080/Insurance/error.html");
//Vector buylist = (Vector) session.getAttribute("PolicyList");
Vector policyList = null;
policyList.addElement(new PolicyObj());
((PolicyObj) policyList.get(0)).setPolicyId("0009800002");
((PolicyObj) policyList.get(0)).setCustomerName("Salim Zeitouni");
((PolicyObj) policyList.get(0)).setAgentName("Jack Smith");
((PolicyObj) policyList.get(0)).setPolicyStatus("Pending");
session.setAttribute("policyTable",policyList);
ServletContext sc = getServletContext();
RequestDispatcher rd = sc.getRequestDispatcher("InsSev1.jsp");
rd.forward(req,resp);
Message was edited by:
sfz1
Message was edited by:
sfz1I am new to servlets/jsp so excuse if I am doing something silly here:
I have a JSP page the suppose to be loading a session attrbute from a simple servlet. When I go to load the jsp page, I get Could not invoke the service() method.
Any help is much appreciated:
Here is my JSP:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page session="true" import="insurance.PolicyObj,java.util.*"%>
<% Vector VTable = (Vector) session.getAttribute("policyTable"); %>
<HTML>
<BODY>
<Form name=listTable action="InsSer" method="post">
<TABLE border="1">
<TBODY>
<TR>
<TD width="258" align="center"><B>Policy Id</B></TD>
<TD width="187" align="center"><B>Customer Name</B></TD>
<TD width="160" align="center"><B>Agent Name</B></TD>
<TD width="134" align="center"><B>Status</B></TD>
</TR>
<TR>
<%
for (int index=0; index < VTable.size();index++) {
PolicyObj TableL = (PolicyObj) VTable.elementAt(index);
%>
<TR bgcolor="#99CCFF">
<TD width="258" align="center"> <%= TableL.getPolicyId()%> </TD>
<TD width="187" align="center"> <%= TableL.getCustomerName()%> </TD>
<TD width="187" align="center"> <%= TableL.getAgentName() %> </TD>
<TD width="187" align="center"> <%= TableL.getPolicyStatus() %></TD>
</TR>
<% } %>
</TBODY>
</TABLE>
<P><INPUT type="submit" name="Submit" value="Refresh Active Policies"></P>
</BODY>
</HTML>
Here is my servlet:
package insurance;
import java.io.IOException;
import java.util.Vector;
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class InsSer extends HttpServlet implements Servlet {
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#HttpServlet()
public InsSer() {
super();
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest arg0, HttpServletResponse resp)
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doPost(req,resp);
// TODO Auto-generated method stub
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest arg0, HttpServletResponse resp)
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//PolicyObj[] policyTable = new PolicyObj[3];
HttpSession session = req.getSession(false);
//if (session == null) {
//resp.sendRedirect("http://localhost:9080/Insurance/error.html");
//Vector buylist = (Vector) session.getAttribute("PolicyList");
Vector policyList = null;
policyList.addElement(new PolicyObj());
((PolicyObj) policyList.get(0)).setPolicyId("0009800002");
((PolicyObj) policyList.get(0)).setCustomerName("Salim Zeitouni");
((PolicyObj) policyList.get(0)).setAgentName("Jack Smith");
((PolicyObj) policyList.get(0)).setPolicyStatus("Pending");
session.setAttribute("policyTable",policyList);
ServletContext sc = getServletContext();
RequestDispatcher rd = sc.getRequestDispatcher("InsSev1.jsp");
rd.forward(req,resp);
Message was edited by:
sfz1
Message was edited by:
sfz1 -
Help needed urgently to get the values from the jsp page.
hi,
I am badly stuck into this problem.Please help me and find a solution.
I am using ms-access and jsp.
my database structure is as given below:
m_emp_no | from_date | to_date | approver| status |
1002 | 22/9/2008 | 23/9/2008|1003 |pending
1004 | 29/9/2008 | 30/9/2008|1003 |pending
2044 | 15/9/2008 | 16/9/2008|3076 |pending
now this is exactly a leave apply scenario where a page is displayed and the user has to fill in the details to apply leave.then the approver has to approve that leaves so even, he should get the details in his account.
for example here 1003 has to approve leaves for 1002 & 1004.i am able to fetch data from database for the particular approver here is the coding:
<html>
<body>
<h2 align="center"><u><b><span style="background-color: #FFFFFF"><font color="#C0C0C0" face="Comic Sans MS">Leave
Approval Requests</font></span></b></u></h2>
<form method="POST" name="f1" action="update.jsp">
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:employee_details");
PreparedStatement p=null;
p=con.prepareStatement("select * from emp_leave_application where approver='"+username+"'");
ResultSet r=p.executeQuery();
while(r.next())
%> <table border="1" width="100%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
<tr>
<td width="100%" bgcolor="#999966"><b><u><%=r.getString(2)%></u></b></td>
</tr>
</table>
<table border="1" width="100%" height="171" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
<tr>
<td width="100%" height="165" valign="top">
<p align="left"><b>User ID</b> :
<input type="text" name="id" value="<%=r.getString(1)%>" size="4
<b>status</b>:<%=r.getString(5)%</p>
<p><b>Leave From</b> : <%=r.getString(2)%></p>
<p><b>Leave From</b> : <%=r.getString(3)%></p>
<p><b>Approve</b> : <select size="1" name="approved">
<option value="Approved">Approved</option>
<option value="Cancelled">Cancelled</option> </select></p>
<%
con.close();
%>
<table border="1" width="100%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
<tr>
<td width="100%" bgcolor="#999966">
<p align="center"><input type="reset" value="Clear" name="B1">
<input type="submit" value="Submit" name="B2"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>{code}
this will display both the rows but when i try to retrieve the values into update.jsp using the code given below it gives me only one value which is the first 1002.
{code}approved=(String)request.getParameter("approved");
id=(String)request.getParameter("id");{code}
but i need both the values to be inserted into the update.jsp only then the approver will be able to approve the leaves individually with respect to the m_emp_no.
please help me out.
thanks in advance.My comments below are all between (((((( and ))))))
<html>
<body>
<h2 align="center"><u><b><span style="background-color: #FFFFFF"><font color="#C0C0C0" face="Comic Sans MS">Leave
Approval Requests</font></span></b></u></h2>
<form method="POST" name="f1" action="update.jsp">
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:employee_details");
PreparedStatement p=null;
p=con.prepareStatement("select * from emp_leave_application where approver='"+username+"'");
ResultSet r=p.executeQuery();
while(r.next())
%> <table border="1" width="100%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
<tr>
<td width="100%" bgcolor="#999966"><b><u><%=r.getString(2)%></u></b></td>
</tr>
</table>
<table border="1" width="100%" height="171" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
<tr>
<td width="100%" height="165" valign="top">
<p align="left"><b>User ID</b> :
<input type="text" name="id" value="<%=r.getString(1)%>" size="4
((((((( in the statement above, name="id" should be changed to something like name="id"<%=ii%>
Where ii is a counter that tells you how many times you have gone through the loop so far.
The reason for this is that each textfield you generate must have a unique name rather than all have the same name
such as 'id'. This change will give them names such as id0, id1, id2. Then when you submit the page, you can uniquely
identify each input textfield.))))))
<b>status</b>:<%=r.getString(5)%</p>
<p><b>Leave From</b> : <%=r.getString(2)%></p>
<p><b>Leave From</b> : <%=r.getString(3)%></p>
<p><b>Approve</b> : <select size="1" name="approved">
(((( the above select also has to have a unique name for each time through the loop. Change it to name="approved"<%=ii%>
<option value="Approved">Approved</option>
<option value="Cancelled">Cancelled</option> </select></p>
<%
con.close();
%>
<table border="1" width="100%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
<tr>
<td width="100%" bgcolor="#999966">
<p align="center"><input type="reset" value="Clear" name="B1">
<input type="submit" value="Submit" name="B2"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
(((((((note you would be better off long term to put your business logic in a servlet and dispatch to the JSP page which will only have the responsiblity to display the data.
Also, connection pooling is better than the above. -
I have tried installing the older version Firefox 3.6. After entering the URL on address bar it does not load after pressing enter or CTRL+ENTER
This issue can be caused by an extension (AVG Safe Search can cause this) that isn't working properly.
Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
* Don't make any changes on the Safe mode start window.
* https://support.mozilla.com/kb/Safe+Mode
* [[Troubleshooting extensions and themes]]
In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
* Help > Restart with Add-ons Disabled
* Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows) -
Unable to get the value from the jsp page.
Hi,
I have developed a JSP, having two split fields seperated by some buttons..The sample code for the same is like this..
(Only the required portion is included)
<script>
function reloadPageOK() {
document.product.method="post"
document.product.action="./TheSamePage.jsp?status=OK"
document.product.submit()
function moveValue(from,to) {
if(from.selectedIndex>=0) {
var text=from[from.selectedIndex].text
var length= to.length
to[length]=new Option(text,from.value,false,false)
from.remove(from.selectedIndex)
function moveAll(from,to) {
if(from.length>0) {
var menutext="";
var i;
var len=from.length
for(i=0;i<len;i++) {
from.selectedIndex=0
menutext=from[0].text
var length= to.length
to[length]=new Option(menutext,from.value,false,false)
from.remove(from.selectedIndex)
</script>
<table width="100%" border="0" cellspacing="0" >
<tr class="contactDetail">
<td width="10%" class="table_grid1" rowspan="4">
<div class="contactDetail">
<select name="lstProviderLeft" size="7" style="width:111">
<option> PDP</option>
<option> Net</option>
<option> Par</option>
<option> Non-Par</option>
</select>
</div>
</td>
<td width="20%" bgcolor="#FFFFFF" class="contactDetail">
<input type="button" value=" > " name="btnLtrProvider" class="button" onclick="moveValue(lstProviderLeft,lstProviderRight)">
</td>
<td width="10%" bgcolor="#FFFFFF" rowspan="4" class="contactDetail"> <font face="Arial, Verdana, Helvetica, sans-serif" size="2" >
<select name="lstProviderRight" size="7" style="width:111"></select>
</font></td>
<tr>
<td width="8%" class="contactDetail">
<input type="button" value=" >> " name="btnLtrAllProvider" class="button" onclick="moveAll(lstProviderLeft,lstProviderRight)" >
</td>
</tr>
<tr>
<td width="8%" class="contactDetail">
<input type="button" name="btnRtlProvider" value=" < " class="button" onclick="moveValue(lstProviderRight,lstProviderLeft)" >
</td>
</tr>
<tr>
<td width="8%" class="contactDetail" height="22">
<input type="button" name="btnRtlAllProvider" value=" << " class="button" onclick="moveAll(lstProviderRight,lstProviderLeft)" >
</td>
</tr>
</table>
<p align = "center"> <input type="button" value=" OK " onclick="reloadPageOK()">
The page is working fine. That is we can move the values in the left field to right as single or group.After submitting I need to get the values in the left & right fields respectively.
I have used the method
request.getParameterValues("lstProviderLeft");
and pointed this to an array of strings,but it returns 'null' .
How can I solve the above problem....Post your comments on this issue
Thanking uprobably the request.getParmeterValues will not work in this case as the name of the 2 select boxes are different....
You can do this utility by using Javascript....concantinate the values of the 2 select boxes and put the concantinated strings (with a delimiter) in two hidden fields and capture the same fields in the target JSP/Servlet.
I have modified ur code...have a look...
--------------------Start-----------------
<html>
<head></head>
<title></title>
<body>
<script language="Javascript">
function reloadPageOK()
document.product.method="post" ;
document.product.action="./TheSamePage.jsp?status=OK" ;
document.product.submit();
function moveValue(from,to)
if(from.selectedIndex>=0)
var text=from[from.selectedIndex].text;
var length= to.length ;
to[length]=new Option(text,from.value,false,false);
from.remove(from.selectedIndex);
function moveAll(from,to)
if(from.length>0)
var menutext="";
var i;
var len=from.length;
for(i=0;i<len;i++)
from.selectedIndex=0;
menutext=from[0].text ;
var length= to.length;
to[length]=new Option(menutext,from.value,false,false) ;
from.remove(from.selectedIndex);
function fnSubmitPage(from,to)
var strfromSelBox = "";
var strtoSelBox = "";
if(from.length>0)
var len=from.length;
for(var i=0;i<len;i++)
strfromSelBox=strfromSelBox+":"+from.text ;
if(to.length>0)
var len=to.length;
for(var i=0;i<len;i++)
strtoSelBox=strfromSelBox+":"+to[i].text ;
document.product.hdFromValue.value=strfromSelBox;
document.product.hdFromValue.value=strtoSelBox;
document.product.method="post" ;
document.product.action="" ;//Name of the JSP or servlet wherever u want to direct to....
document.product.submit();
</script>
<form name="product">
<input type="hidden" name="hdFromValue">
<input type="hidden" name="hdToValue">
<table width="100%" border="0" cellspacing="0" >
<tr class="contactDetail">
<td width="10%" class="table_grid1" rowspan="4">
<div class="contactDetail">
<select name="lstProviderLeft" size="7" style="width:111">
<option> PDP</option>
<option> Net</option>
<option> Par</option>
<option> Non-Par</option>
</select>
</div>
</td>
<td width="20%" bgcolor="#FFFFFF" class="contactDetail">
<input type="button" value=" > " name="btnLtrProvider" class="button" onclick="moveValue(lstProviderLeft,lstProviderRight)">
</td>
<td width="10%" bgcolor="#FFFFFF" rowspan="4" class="contactDetail">
<font face="Arial, Verdana, Helvetica, sans-serif" size="2" >
<select name="lstProviderRight" size="7" style="width:111">
</select>
</font>
</td>
<tr>
<td width="8%" class="contactDetail">
<input type="button" value=" >> " name="btnLtrAllProvider" class="button" onclick="moveAll(lstProviderLeft,lstProviderRight)" >
</td>
</tr>
<tr>
<td width="8%" class="contactDetail">
<input type="button" name="btnRtlProvider" value=" < " class="button" onclick="moveValue(lstProviderRight,lstProviderLeft)" >
</td>
</tr>
<tr>
<td width="8%" class="contactDetail" height="22">
<input type="button" name="btnRtlAllProvider" value=" << " class="button" onclick="moveAll(lstProviderRight,lstProviderLeft)" >
</td>
</tr>
</table>
<input type="button" value=" OK " onclick="reloadPageOK()">
<input type="button" value=" Submit " onclick="fnSubmitPage(lstProviderRight,lstProviderLeft)">
</form>
</body>
</html>
--------------------Finish---------------
Hope this helps...
Thanks -
How can I make the jsp pages not displayed by using the navigation class?
I'm right now implementing a function on my program GUI . It's like whenever I click "STOP THE SERVER" button on the main page, I need those jsp pages relates to the server running to be not displayed, even by directly type in the URL(that's just stay in the main page), How can I do that? I heard that a navigation class might do it, but I'm not sure how. It might be great if some experts could help me!! Thanx a million !!
ShannonSee:
* [[Removing the Search Helper Extension and Bing Bar]]
You can use one of these extensions to adjust the default font size and page zoom on web pages:
* Default FullZoom Level - https://addons.mozilla.org/firefox/addon/6965
* NoSquint - https://addons.mozilla.org/firefox/addon/2592 -
ECP Page not loading after installing SP3 on Exchange 2010 CAS&HUB Server
I have installed SP3 on my Exchange CAS Server after that OWA was not working, hence I have reset owa, ecp,ews,oab, autodiscover & active sync virtual directory from EMC. After that OWA is started working.
But While accessing ECP , content is not loading properly. I have reset virtual directory of ecp 2 times but problem is still same.
KashiDid you tested different browser?
Cheers,
Gulab Prasad
Technology Consultant
Blog:
http://www.exchangeranger.com Twitter:
LinkedIn:
Check out CodeTwo’s tools for Exchange admins
Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. -
Pages not loading until refresh
Hi all,
Recently I have noticed on my Ipad and PC that webpages like google for example do not load, they get stuck until I refresh then it will go through and load the page. Also youtube has problems when I am using the ipad with certain videos just refusing to load. Wat can I do to rectify this problem!
Thanks
I am using a Netgear R6300 routerCould be a DNS problem. Try using Google DNS instead - 8.8.8.8 and 8.8.4.4
If you found this post helpful, please click on the star on the left
If not, I'll try again -
Page not loading until refresh still in 4
I don't know if anyone else gets this and I would be interested to know why it happens.
Occasionaly I will pick a site that just sits there try to load. Reselecting it makes it load no problem.
What could cause this?
One other thing that bugs me the search forum bar on the right of you screen why does it have a small search bar within a bigger one, its been that way for a long time.
Many thanksHi,
What could cause this?
That's usually symptomatic of DNS lookup issues. Try using the DNS settings provided by [OpenDNS|www.opendns.com] to see if it makes any difference.
why does it have a small search bar within a bigger one
Dodgy coding on the forum page, nothing more than that I'm sure Apple will eventually get around to fixing it. -
Pages not loading after pressing the enter button
when i write some adress into the navigation panel and press enter nothing happens. Pages doesn`t start to load even from the history. Only thing that works are bookmarks, they load on, and I can browse the internet from the sites. By the way, the enter button works in other programs well. Thanks for ideas
Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
*Don't make any changes on the Safe mode start window.
*https://support.mozilla.com/kb/Safe+Mode -
Web pages not loading after removing **** blocker
I installed a **** blocker on my iMac and was not able to open certain sites. I removed the **** blocker and still can't open sites (not ****). I ave unplugged and plugged. I have reloaded Safari and the OS X. I have downloaded software from anti-spam to malware and still I can't access certain sites.
Any third-party software that doesn't install by drag-and-drop into the Applications folder, and uninstall by drag-and-drop to the Trash, is a system modification.
Whenever you remove system modifications, they must be removed completely, and the only way to do that is to use the uninstallation tool, if any, provided by the developers, or to follow their instructions. If the software has been incompletely removed, you may have to re-download or even reinstall it in order to finish the job.
I never install system modifications myself, and except as stated in this comment, I don't know how to uninstall them. You'll have to do your own research to find that information.
Here are some general guidelines to get you started. Suppose you want to remove something called “BrickMyMac” (a hypothetical example.) First, consult the product's Help menu, if there is one, for instructions. Finding none there, look on the developer's website, say www.brickmymac.com. (That may not be the actual name of the site; if necessary, search the Web for the product name.) If you don’t find anything on the website or in your search, contact the developer. While you're waiting for a response, download BrickMyMac.dmg and open it. There may be an application in there such as “Uninstall BrickMyMac.” If not, open “BrickMyMac.pkg” and look for an Uninstall button. The uninstaller might also be accessed by clicking the Customize button, if there is one.
Back up all data before making any changes.
You will generally have to restart the computer in order to complete an uninstallation. Until you do that, there may be no effect, or unpredictable effects.
If you can’t remove software in any other way, you’ll have to erase and install OS X. Never install any third-party software unless you're sure you know how to uninstall it; otherwise you may create problems that are very hard to solve.
Trying to remove complex system modifications by hunting for files by name often will not work and may make the problem worse. The same goes for "utilities" such as "AppCleaner" and the like that purport to remove software. -
How to load only the jsp page even after applying template
Hi,
I have a webpage template with header,footer, Dynamic Menu etc. Now I assigned this .jtpl template to all my existing fases jsp files.
The problem is when I submit a form in jsp, the entire page including template gets loaded again by which we can notice significant time for loading menus and other things.
Is there any way to avoid this entire template loading and make only the jsp page to load? Please help
May be this can be achieved by frames. But I dont have idea on how I can merge template with frames. If someone can provide that even would help me better.
Thanks in advance.Hi
I found the solution .
<html>
<head>
<script language="JavaScript">
function checkRefresh()
if( document.refreshForm.visited.value == "" )
alert('first ime');
// This is a fresh page load
document.refreshForm.visited.value = "1";
// You may want to add code here special for
// fresh page loads
else
</script>
</head>
<body onLoad="JavaScript:checkRefresh();">
<form name="refreshForm">
<input type="hidden" name="visited" value="" />
</form>
</body>
</html> -
Get Javascript Value in a JSP page
Let's say this is my javascript function in a html page
.<head>
<!-- Function getFields -->
function getFields(){
if (row >= 0){
for(var i=0; i<costForm.elements.length; i++){
if(costForm.elements.type == "text" || costForm.elements[i].type == "hidden"){
dynTableFields[i] = (costForm.elements[i].value)? costForm.elements[i].value : "";
if(costForm.elements[i].type == "select-one"){
dynTableFields[i] = costForm.elements[i].selectedIndex;
</head>
How do i get the costForm.elements.length value in another jsp page. Coz the html page has dynamic rows by the users. and i need the values in the jsp page to know how many rows the user created.
using normal request.getParameter("costForm.elements.length") doesn't workrequest.getParameter() will only get data that's been submitted thru a form or the query string of a URL. You'd have to record the length in a hidden field to read it on the back end, and then you can't just loop thru the fields like that in JSP on the server anyway, unless you have all fields named with a prefix and number, like: field1, field2, field3, etc.
-
The graph dose not shown after running the Customize JSP Page.
Hi All,
While creating customize JSP I am facing one problem - The graph dose not shown after running the Customize JSP Page.
What are the possibilities ? any body has any Idea Please help meHi all,
I have the same issue! Any solution??
Thanks
BI Beans Diagnostics(v1.0.2.0) 11/10/06
=========================================================
JDEV_ORACLE_HOME .......................... = D:\jdev1012b1913
JAVA_HOME ................................. = D:\ORDB10gR2Home\jdk
JDeveloper version ........................ = 10.1.2.1.0.1913
BI Beans release description .............. = BI Beans 10.1.2 Production Release
BI Beans component number ................. = 10.1.2.67.0
BI Beans internal version ................. = 3.2.2.0.24.2
Connect to database ....................... = Successful
JDBC driver version ....................... = 10.1.0.4.2
JDBC JAR file location .................... = D:\jdev1012b1913\jdbc\lib
Database version .......................... = 10.2.0.2.0
OLAP Catalog version ...................... = 10.2.0.2.0
OLAP AW Engine version .................... = 10.2.0.2.0
OLAP API Server version ................... = 10.2.0.2.0
BI Beans Catalog version .................. = 3.2.2.0.24
OLAP API JAR file version ................. = "10.1.0.5.0"
OLAP API JAR file location ................ = D:\jdev1012b1913\jdev\lib\ext
Load OLAP API metadata .................... = Successful
Number of metadata folders ................ = 1
Number of metadata measures ............... = 23
Number of metadata dimensions ............. = 8
Maybe you are looking for
-
How to add additional field to the existing report
hi, report name is RHXPE_EXPIRED_QUALI if u execute report alv list is genereted with like this. object type, id of related object, object name, object type, id of related object,last name, first name like this where can i get these field descriptios
-
Can I use my ipad with an o2 sim card to to find a local carrier like I can with my iphone ?
-
How do I create a run-in paragraph in 7.0? Thanks!
-
OS X Snow Leopard install from (non-boot) USB memory stick
oi~ just bought this second hand and after i finally got into it (the seller forgot name/password) it turns out the DVD drive is malfunctioning, i was able to watch part of a movie but it will not boot from it nor let me install from DVD. (seller is
-
Wifi restriction in a K-8 school
Is there a way to create a configuration where the ipads can only connect to a certain SSID. If they use them close enough to the windows they can connect to local wifi connections from the neighboring houses. This causes huge problems as they are re