Problem retrieving javabean instance from request in JSP
I am using WSAD and I created a javabean called confirmBean in default package which contains two private properties fname, lname and public setters and getters
In a servlet I placed values in the bean, then placed the bean in a request and then forwarded to confirm.jsp
confirmBean cb = new confirmBean();
cb.setFname("testing");
req.setAttribute("mybean", cb);
req.getRequestDispatcher("/confirm.jsp").forward(req,res);
Here is my JSP, I used java syntax for retrieving javabean:
<HTML>
<HEAD>
<TITLE>confirm.jsp</TITLE>
</HEAD>
<%@ page
language="java"
contentType="text/html; charset=ISO-8859-1"%>
<%@ page import="confirmBean"%>
<BODY>
<% confirmBean myBean = (confirmBean)request.getAttribute("MYBEAN"); %>
<%= myBean.getFname() %>
</BODY>
</HTML>
and here is the error i am getting when executing:
Error 500: Unable to compile class for JSP c:\testWorkspace\.metadata\.plugins\com.ibm.etools.server.core\tmp0\cache\localhost\server1\Test\TestWeb.war\_confirm.java:3: '.' expected import confirmBean; ^ An error occurred at line: 11 in the jsp file: /confirm.jsp Generated servlet error: c:\testWorkspace\.metadata\.plugins\com.ibm.etools.server.core\tmp0\cache\localhost\server1\Test\TestWeb.war\_confirm.java:78: cannot resolve symbol symbol : class confirmBean location: class org.apache.jsp._confirm confirmBean myBean = (confirmBean)request.getAttribute("MYBEAN"); ^ An error occurred at line: 11 in the jsp file: /confirm.jsp Generated servlet error: c:\testWorkspace\.metadata\.plugins\com.ibm.etools.server.core\tmp0\cache\localhost\server1\Test\TestWeb.war\_confirm.java:78: cannot resolve symbol symbol : class confirmBean location: class org.apache.jsp._confirm confirmBean myBean = (confirmBean)request.getAttribute("MYBEAN"); ^ 3 errors
Please help!!!!
1 - Put your bean in a proper package. As of Java1.4 classes in the default package are not visible :
http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=c85f07c1ce8f344d787b7a5146d68:WuuT?bug_id=43615752 - As a matter of style, class names should always start with a capital letter. ie ConfirmBean
3 - Rather than declaring the bean, and retrieving it, from the request manually, have a useBean tag:
<jsp:useBean id="MYBEAN" class="com.mypackage.ConfirmBean" scope="request"/>
of course the id has to be the same as the attribute in scope.
Hope this helps,
evnafets
Similar Messages
-
Problem in getting attribute from request.
HI
I have a JSR 168 portlet which was earlier running in tomcat 6 and liferay...i'm now migrating that in webcenter portal framework 11g.
after migration when i run it ... i have set some attribute in actionRequest class of processAction method in my portlet and then i 'm getting it in jsp from request(explicit varriable) varriable....
this was working earlier in liferay/tomcat but somehow it's not working here ... i didn't change any code here... apart from some lspecific ib/class from liferay to oracle.
please suggest
thanksI think you are mixing some things...
First of all, if you are creating basic JSP portlets, you don't need to use the ADFPortletBridge. This is only needed when you develop JSF portlets and are using the ADF technology.
Second of all, you are switching from JSR 168 to 286. The standard has some changes but i don't really know if these changes affect the lifecycle of the portlets in a way that the setAttribute will be broken...
There are a lot of changes in the parameters so IPC is made easy with JSR 286.
Maybe you cna elaborte some more about the specific case and we can provide a valid workaround? -
Problem getting arraylist values from request
Hi All,
I am trying to display the results of a search request.
In the jsp page when I add a scriplet and display the code I get the values else it returns empty as true.Any help is appreciated.
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<%@ include file="/includes/header.jsp"%>
<title>Research Results</title>
</head>
<body>
<div class="ui-widget ui-widget-content">
<%
ArrayList<Research> research = (ArrayList<Research>) request.getAttribute("ResearchResults");
Iterator iterator = research.iterator();
while(iterator.hasNext()){
Research r = (Research) iterator.next();
out.println("Result Here"+r.getRequesterID());
out.println("Result Here"+r.getStatus());
%>
<form>
<c:choose>
<c:when test='${not empty param.ResearchResults}'>
<table cellspacing="0" cellpadding="0" id="research" class="sortable">
<h2>RESEARCH REQUESTS</h2>
<tr>
<th><a href="#">RESEARCH ID</a></th>
<th><a href="#">REQUESTOR NAME</a></th>
<th><a href="#">DUE DATE</a></th>
<th><a href="#">REQUEST DATE</a></th>
<th><a href="#">CLIENT</a></th>
<th><a href="#">STATUS</a></th>
<th><a href="#">PRIORITY</a></th>
</tr>
<c:forEach var="row" items="${param.ResearchResults}">
<tr title="">
<td id="researchID">${row.RESEARCH_ID}</td>
<td>${row.REQUESTER_FNAME} ${row.REQUESTER_LNAME}</td>
<td><fmt:formatDate pattern="MM/dd/yyyy" value="${row.DUE_DATE}"/></td>
<td><fmt:formatDate pattern="MM/dd/yyyy" value="${row.CREATED_DATE}"/></td>
<td>${row.CLIENT}</td>
<td>
<c:choose>
<c:when test="${row.STATUS=='10'}">New Request</c:when>
<c:when test="${row.STATUS=='20'}">In Progress</c:when>
<c:when test="${row.STATUS=='30'}">Completed</c:when>
</c:choose>
</td>
<td>
<c:choose>
<c:when test="${row.PRIORITY=='3'}">Medium</c:when>
<c:when test="${row.PRIORITY=='2'}">High</c:when>
<c:when test="${row.PRIORITY=='1'}">Urgent</c:when>
</c:choose>
</td>
</tr>
</c:forEach>
</table>
</c:when>
<c:otherwise>
<div class="ui-state-highlight ui-corner-all">
<p><b>No results Found. Please try again with a different search criteria!</b> </p>
</div>
</c:otherwise>
</c:choose>
</form>
<%@ include file="/includes/footer.jsp"%>
</div>
</body>
</html>What is ResearchResults?
Is it a request parameter or is it a request attribute?
Parameters and attributes are two different things.
Request parameters: the values submitted from the form. Always String.
Request attributes: objects stored into scope by your code.
They are also accessed slightly differently in EL
java syntax == EL syntax
request.getParameter("myparameter") == ${param.myparameter}
request.getAttribute("myAttribute") == ${requestScope.myAttribute}
You are referencing the attribute in your scriptlet code, but the parameter in your JSTL/EL code.
Which should it be?
cheers,
evnafets -
Problem while creating instance of bean in jsp
have created a bean ConnBean in package ask. I am using apache tomcat 4.0.1 as a web server.
The ask folder is in webapps/WEB-INF/classes as well as in webapps/Root/WEB_INF/classes and in ask folder ConnBean.class is stored.
Url for jsp is webapps/Root/jdbc.jsp
In jsp file the tag used is <jsp.useBean id="conn" class="ask.ConnBean" />
when jsp is executed web server shows error as following
Apache Tomcat/4.0.1 - HTTP Status 500 - Internal Server Error
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 10 in the jsp file: /jdbc.jsp
Generated servlet error:
C:\Program Files\Apache Tomcat 4.0\work\localhost\_\jdbc$jsp.java:75: Class ask.ConnBean not found.
ask.ConnBean conn = null;
^
An error occurred at line: 10 in the jsp file: /jdbc.jsp
Generated servlet error:
C:\Program Files\Apache Tomcat 4.0\work\localhost\_\jdbc$jsp.java:78: Class ask.ConnBean not found.
conn= (ask.ConnBean)
^
An error occurred at line: 10 in the jsp file: /jdbc.jsp
Generated servlet error:
C:\Program Files\Apache Tomcat 4.0\work\localhost\_\jdbc$jsp.java:83: Class ask.ConnBean not found.
conn = (ask.ConnBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "ask.ConnBean");
^
3 errors
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:546)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
at java.lang.Thread.run(Unknown Source)have created a bean ConnBean in package ask. I am
using apache tomcat 4.0.1 as a web server.
The ask folder is in webapps/WEB-INF/classes Remove it. This will just cloud the issue.
as well
as in webapps/Root/WEB_INF/classes and in ask folderThat should be webapps/ROOT/WEB-INF/classes
ConnBean.class is stored.
Url for jsp is webapps/Root/jdbc.jspwebapps/ROOT/jdbc.jsp
>
In jsp file the tag used is <jsp.useBean id="conn"
class="ask.ConnBean" />After making the above changes, see if the error still occurs. Does your ConnBean have a public no args constructor? -
Problem Retrieving DATA files from Zen To
Has anybody else had this problem?
I moved a bunch of data files to my zen touch. My computer hardri've
failed and now I want to copy the data back.
BUT when I try to do it, I get an error message that I can't remove
the data files.
I called tech support once and they had me "clean" the hardri've --
didn't work. Then he recommended JBHTTP. I downloaded that
(free) and it does work, but I can't remove the files <EM>within the file</EM>
<EM>structure</EM> -- and only one at a time.
This is better than nothing, but it will take a long time to remove
all 3000+ files.
I found a recommendation for NotMad on the web, but the free
version will not do data transfers, and I don't want to pay for it
if it isn't going to work.
Has anyone had any similar problems? Any solutions? Any
suggestions?
Please help. I need it. :angry:
<FONT face="Comic Sans MS" color=#336600 size=4>JTI believe via Xtreamer, in the trial version of Notmad, you can also download data files. But it sounds like the same process as JBHTTP i.e. slow and one-by-one.
I've seen before that new drivers and firmware update can fix this. I've also seen that new drivers have broken data retrieval, and reverting back to the install CD drivers have fixed it. It's worth trying.
It's a good idea to check data retrieval on a device once you've copied some files over, just to test. Also never trust important files (audio or data) to an MP3 player as the sole source. -
Problem retrieving network printer from a machine
I used the following script code gwmi -class Win32_Printer -Filter 'Shared = "True"'to retrieve the network but it does not get all of the ones..... but it returns the local one......
michael john ocasioHi,
The following command will give you all shared printers on a certain computer, if that is the output you wanted.
Get-WmiObject win32_printer -Filter 'Sharename LIKE "%"'
Let us know if you need further assistance!
Microsoft Certified Trainer
MCSE: Desktop, Server, Private Cloud, Messaging
Blog: http://365lab.net -
Problem calling Java method from JavaScript in JSP / ADF
Hi all,
In my JavaScript onMouseUp() function, I need to call a method on my Java backing bean. How is this done? Info on the web indicates a static Java method can be called by simply "package.class.staticMethod(...)". but when I put the statement
"jsf.backing.GlobalRetriever.createBasemap(affectedLayer);"
I get an error message "jsf is undefined".
The functionality I'm trying to get is: I have a custom slider control and based on its value, I want to call oracle map viewer specifying a map extent of the (current extent / slider value) to do a zoom in/out. In addition, the slider uses a onMouseMove() function to change the size of the image display so it looks like a dynamic zoom in/out.
Please assist or let me know if I can provide some additional information. Thanks in advance.
Jim GreethamNo. The Java and Javascript in a Faces application are really working in two different universes.
Java is running on the server. It generates HTML (and sometimes even Javascript) and sends that to the client machine. That's where all your backing beans are.
Javascript runs directly in the browser. There's no way anything on the server can have access to anything you define in Javascript, unless you explicitly send that information back to the server, either via standard form submission (which only works when someone presses a "Submit" button) or via an Ajax-type call. So otherwise, nothing you define in Javascript will ever be available to a backing bean. -
Parameter passing from servlet to jsp page
Hi
I m facing problem of parameter passing from servlet to jsp ..
plz help me...
I m using as ...
in servlet code I m using ...
request.setAttribute("string",parameter);
and in jsp..
request.getParameter("string");
regard's
JAI KUMARHi Jaykumar
You should use
<%= request.getAttribute("sting") %> or
${string}
in your jsp. I think you are trying to retrive the parameter instead of attribute.
Thanks -
Can't pass bean or request attribute from servlet to JSP
Hi,
I have a web app that starts with a file upload page that uses commons io fileUpload, passes the info on to a servlet. Then the servlet passes its info on to a JSP.
I can upload the file onto the web app successfully. I also can call that uploaded file directly from the JSP (i.e. bypassing the servlet) without problem. But if I try to chain all 3 together while passing the url for the file directly as an attribute or as a bean containing file's url, I get premature end of file or can't find the property in the bean. I'm not sure what I'm doing wrong.
the error message:
org.apache.jasper.JasperException: javax.servlet.jsp.JspException: Premature end of file.
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
servlet.UploadServlet.processRequest(UploadServlet.java:329)
servlet.UploadServlet.doPost(UploadServlet.java:363)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
root cause
javax.servlet.ServletException: javax.servlet.jsp.JspException: Premature end of file.
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:854)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.clinTrialsEditor_jsp._jspService(clinTrialsEditor_jsp.java:144)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
servlet.UploadServlet.processRequest(UploadServlet.java:329)
servlet.UploadServlet.doPost(UploadServlet.java:363)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
root cause
org.xml.sax.SAXParseException: Premature end of file.
org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSource(ParseSupport.java:227)
org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSourceWithFilter(ParseSupport.java:193)
org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseReaderWithFilter(ParseSupport.java:199)
org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseStringWithFilter(ParseSupport.java:206)
org.apache.taglibs.standard.tag.common.xml.ParseSupport.doEndTag(ParseSupport.java:138)
org.apache.jsp.clinTrialsEditor_jsp._jspx_meth_x_parse_0(clinTrialsEditor_jsp.java:189)
org.apache.jsp.clinTrialsEditor_jsp._jspService(clinTrialsEditor_jsp.java:88)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
servlet.UploadServlet.processRequest(UploadServlet.java:329)
servlet.UploadServlet.doPost(UploadServlet.java:363)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
Code from the servlet:
String dName = "http://localhost:8084/fileUploadApp/faces/";
url = dName + fileName;
beans.FileInfo.setFileName(fileName);
request.setAttribute("fileInfo", new FileInfo());
beans.FileInfo.setDName(dName);
beans.FileInfo.setDirName(dirName);
beans.FileInfo.setUrl(url);
File saveTo = new File(dirName + fileName);
//if I use the next 2 lines I get "can't resolve symbol - create field, local var or parameter FileInfo"
FileInfo fileInfo = new beans.FileInfo();
request.setAttribute("fileInfo", FileInfo); //error here
request.setAttribute("myUrl", url);
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/clinTrialsEditor.jsp");
dispatcher.forward(request, response);
on JSP
<jsp:useBean id="fileInfo" class="beans.FileInfo" scope="request"/>
<jsp:setProperty name="fileInfo" property="*"/>
<%--<c:import url="http://localhost:8084/fileUploadApp/faces/lowVision.xml" var="url" /> --%> <c:import url="${myUrl}" var="url" />
<x:parse xml="${url}" var="clin" />
etc...x:set with xpath expressions
Can anyone spot my error(s)?
Thanks for the help!Thanks for your reply, Ram.
I made the change but I get an error "Unable to find a value for "fileName" in bean of type beans.FileInfo"
Here's the bean:
package beans;
public class FileInfo {
private static String fileName;
private static String dirName;
private static String dName;
private static String url;
/** Creates a new instance of FileInfo */
public FileInfo() {
public static void setFileName(String fn){
fileName = fn;
public static String getFileName(){
return fileName;
public static void setDirName(String dn){
dirName = dn;
public static String getDirName(){
return dirName;
public static void setDName(String d){
dName = d;
public static String getDName(){
return dName;
public static void setUrl(String u){
url = u;
public static String getUrl(){
return url;
Pertinent parts of servlet:
String dirName = "C:/MyNBProjects/fileUploadApp/web/"; //save file to web app then convert to url so it can be called to show it on next page
String dName = "http://localhost:8084/fileUploadApp/faces/";
url = dName + fileName;
FileInfo fileInfo = new FileInfo();
fileInfo.setFileName("fileName");
fileInfo.setDName("dName");
fileInfo.setDirName("dirName");
fileInfo.setUrl("url");
request.setAttribute("fileName", fileName);
request.setAttribute("url", url);
request.setAttribute("fileInfo", fileInfo);
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/clinTrialsEditor.jsp");
dispatcher.forward(request, response);
jsp:
<jsp:useBean id="fileInfo" class="beans.FileInfo" scope="request"/>
<jsp:setProperty name="fileInfo" property="*"/>
url = <c:out value="${url}" />
//works; not part of bean
fileName = <c:out value="${fileName}" />
//works; not part from the bean
fileInfo.fileName = <jsp:getProperty name="fileInfo" property="fileName" />
//doesn't work
<%--fileName = <c:out value="${fileInfo.fileName}" /> //doesn't work
Can you spot the error(s)?
Thanks for your help. -
Cannot a get JSP page instance from a page being destroyed
We have a J2EE app, using Struts + Tiles (build 1.1-b3), running on Win2KPro, Ora9ias v9.0.3. The application is roles-based, and different users see different versions of the same page based on their role authorizations. Occasionally, when multiple users in different roles are requesting the same page, the app returns the following exception:
OracleJSP:
JSP Error:
Request URI:/fast/WEB-INF/jsp/tiles/layouts/baseLayout.jsp
Exception:
javax.servlet.ServletException: Cannot a get JSP page instance from a page being destroyed
at oracle.jsp.runtimev2.JspPageInstFacade.getInstance(JspPageInstFacade.java:147)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:303)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:119)
at org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude(TilesUtilStrutsModulesImpl.java:124)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:161)
at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:703)
at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:818)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:467)
at web2d_inf._jsp._tiles._layouts._baseLayout._jspService(_baseLayout.java:445)
[SRC:/WEB-INF/jsp/tiles/layouts/baseLayout.jsp:149]
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1033)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:269)
at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:249)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:303)
at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:401)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:505)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at com.gal.fast.portal.web.FastActionServlet.service(FastActionServlet.java:110)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:148)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:72)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:536)
All the code in the two custom classes above ( com.gal.fast.portal.web.SessionInitializedFilter and com.gal.fast.portal.web.FastActionServlet ) has been commented out to the point that they are NOOP stubs.
We only see this with multiple near-simultaneous requests for the same page with differet roles. It smells like a threading issue to me, but I'm no expert (hence this post). Any thoughts?
--mattWe have a J2EE app, using Struts + Tiles (build 1.1-b3), running on Win2KPro, Ora9ias v9.0.3. The application is roles-based, and different users see different versions of the same page based on their role authorizations. Occasionally, when multiple users in different roles are requesting the same page, the app returns the following exception:
OracleJSP:
JSP Error:
Request URI:/fast/WEB-INF/jsp/tiles/layouts/baseLayout.jsp
Exception:
javax.servlet.ServletException: Cannot a get JSP page instance from a page being destroyed
at oracle.jsp.runtimev2.JspPageInstFacade.getInstance(JspPageInstFacade.java:147)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:303)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:119)
at org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude(TilesUtilStrutsModulesImpl.java:124)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:161)
at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:703)
at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:818)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:467)
at web2d_inf._jsp._tiles._layouts._baseLayout._jspService(_baseLayout.java:445)
[SRC:/WEB-INF/jsp/tiles/layouts/baseLayout.jsp:149]
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1033)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:269)
at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:249)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:303)
at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:401)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:505)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at com.gal.fast.portal.web.FastActionServlet.service(FastActionServlet.java:110)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at com.gal.fast.portal.web.SessionInitializedFilter.doFilter(SessionInitializedFilter.java:105)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:148)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:72)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:536)
All the code in the two custom classes above ( com.gal.fast.portal.web.SessionInitializedFilter and com.gal.fast.portal.web.FastActionServlet ) has been commented out to the point that they are NOOP stubs.
We only see this with multiple near-simultaneous requests for the same page with differet roles. It smells like a threading issue to me, but I'm no expert (hence this post). Any thoughts?
--matt -
Problem with JavaBeans in JSP.IT'S URGENT!!!
Hi, i have problems with JavaBeans in JSP.
In a jsp file( locating in ROOT directory of tomcat 4.0.6 :jakarta-tomcat-4.0.6\webapps\root ) i have this code:
<jsp:useBean id="paramBean" class="licentza.ParamBean" />
<jsp:setProperty name="paramBean"
property="nume"
value='<%= request.getParameter("numeUser") %>' />
where ParamBean it's a "bean" class locating in jakarta-tomcat-4.0.6\webapps\examples\web-inf\classes\licentza (licentza is the package i'm using).
And i get this error:
Generated servlet error:
D:\jakarta-tomcat-4.0.6\work\Standalone\localhost\_\dora\intrare2$jsp.java:67: Class licentza.ParamBean not found.
ParamBean paramBean = null;
What is the problem?Thank you.Hi,
Put the class file or the package under :jakarta-tomcat-4.0.6\webapps\root\WEB-INF\classes.
Rajesh -
How to retrieve multiple data from table and represent it in jsp page
Hi
The below JavaScript code is used to add row in the table when I want to add multiple row data into table for single entry no field.
<html> function addRow()
i++;
var newRow = document.all("tblGrid").insertRow();
var oCell = newRow.insertCell();
oCell.innerHTML = "<input name='srno"+i+"' type='text' id='srno"+i+"' size=10>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='itmcd"+i+"' type='text' id='itmcd"+i+"' size='10'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='itmnm"+i+"' type='text' id='itmnm"+i+"' size='15'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='indentqty"+i+"' type='text' id='indentqty"+i+"' size='10'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='uom"+i+"' type='text' id='uom"+i+"' size='10'><input type='hidden' name='mcode"+i+"'id='mcode"+i+"'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='packqty"+i+"' type='text' id='packqty"+i+"' size='10'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='packuom"+i+"' type='text' id='packuom"+i+"' size='10'><input type='hidden' name='pack"+i+"' id='pack"+i+"'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='rate"+i+"' type='text' id='rate"+i+"' size='10'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='dor"+i+"' type='text' id='dor"+i+"' size='0' onClick='"+putdate(this.name)+"'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='bccode"+i+"' type='text' id='bccode"+i+"' size='10'></td><input type='hidden' name='bcc"+i+"' id='bcc"+i+"'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='cccode"+i+"' type='text' id='cccode"+i+"' size='10'></td><input type='hidden' name='ccc"+i+"' id='ccc"+i+"'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='remark2"+i+"' type='text' id='remark2"+i+"' size='20'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input type='button' value='Delete' onclick='removeRow(this);' />";
// oCell = newRow.insertCell();
// oCell.innerHTML = "<input type='button' value='Clear' onclick='clearRow(this);' />";
}<html> Then this data are send to the next Servlet for adding into two table.
My header portion data are added into one table which added only one row in table. while footer section data are added into the no of rows in another table dependent on No. of
Rows added into jsp page.
Here is an code for that logic.
<html>
ArrayList<String> mucode = new ArrayList<String>();
ArrayList<Integer> serials = new ArrayList<Integer>();
ArrayList<Integer> apxrate = new ArrayList<Integer>();
ArrayList<Integer> srname = new ArrayList<Integer>();
ArrayList<String> itcode = new ArrayList<String>();
ArrayList<String> itname = new ArrayList<String>();
ArrayList<Integer> iqnty = new ArrayList<Integer>();
ArrayList<String> iuom = new ArrayList<String>();
ArrayList<Integer> pqnty = new ArrayList<Integer>();
ArrayList<String> puom1 = new ArrayList<String>();
ArrayList<Integer> arate = new ArrayList<Integer>();
ArrayList<String> rdate = new ArrayList<String>();
ArrayList<String> bcs = new ArrayList<String>();
ArrayList<String> ccs = new ArrayList<String>();
ArrayList<String> remarkss = new ArrayList<String>();
//ArrayList<Integer> qtyrecs = new ArrayList<Integer>();
//ArrayList<String> dors = new ArrayList<String>();
//ArrayList<String> remarks = new ArrayList<String>();
String entryn = request.getParameter("entryno");
String rows = request.getParameter("rows");
out.println(rows);
//String Entryno = request.getParameter("entryno");
// out.println(Entryno);
int entryno = 0,reqqty = 0,srno = 0,deprequest = 0,rowcount = 0;
if(!Entryno.equals("")){
entryno = Integer.valueOf(Entryno);
if(!rows.equals("")){
rowcount = Integer.valueOf(rows);
for(int i=1;i<=rowcount;i++){
if(request.getParameter("srno"+i)!=null){
serials.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
out.println(serials.size());
for(int i=1;i<=rowcount;i++){
if(request.getParameter("srno"+i)!=null){
srname.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
out.println(srname.get(0));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("itmcd"+i)!=null){
itcode.add(request.getParameter("itmcd"+i).trim());
} //out.println(itcode.get(i));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("itmnm"+i)!=null){
itname.add(request.getParameter("itmnm"+i).trim());
}//out.println(itname.get(i));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("indentqty"+i)!=null){
iqnty.add(Integer.valueOf(request.getParameter("indentqty"+i).trim()));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("uom"+i)!=null){
iuom.add(request.getParameter("uom"+i).trim());
}//out.println(iuom.get(i));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("mcode"+i)!=null){
mucode.add(request.getParameter("mcode"+i).trim());
for(int i=1;i<=rowcount;i++){
if(request.getParameter("packqty"+i).equals("")){
pqnty.add(0);
}else
pqnty.add(Integer.valueOf(request.getParameter("packqty"+i).trim()));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("pack"+i)!=null){
puom1.add(request.getParameter("pack"+i).trim());
}else
puom1.add("");
for(int i=1;i<=rowcount;i++){
if(request.getParameter("rate"+i).equals("")){
arate.add(0);
}else
arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));
/* for(int i=1;i<=rowcount;i++){
if(request.getParameter("rate"+i)!=null){
arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("dor"+i)!=null){
try{
rdate.add(dashdate.format(slashdate.parse(request.getParameter("dor"+i).trim())));
}catch(ParseException p){p.printStackTrace();}
}else
{ rdate.add("");}
for(int i=1;i<=rowcount;i++){
if(request.getParameter("bcc"+i)!=null){
bcs.add(request.getParameter("bcc"+i).trim());
}out.println(bcs.get(0));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("ccc"+i)!=null){
ccs.add(request.getParameter("ccc"+i).trim());
}out.println(ccs.get(0));
for(int i=1;i<=rowcount;i++){
out.println("remark2");
if(request.getParameter("remark2"+i)!=null){
remarkss.add(request.getParameter("remark2"+i).trim());
}out.println(remarkss.get(0));
ArrayList<String> Idate = new ArrayList<String>();
for(int i=1;i<=rowcount;i++){
if(request.getParameter("dateindent"+i)!=null){
try{
Idate.add(dashdate.format(dashdate.parse(request.getParameter("dateindent"+i).trim())));
}catch(ParseException p){p.printStackTrace();}
String Rdate = dashdate.format(new java.util.Date());
String tdate = dashdate.format(new java.util.Date());
// String Indentdate = dashdate.format(new java.util.Date());
// String ApprovedT1 = dashdate.format(new java.util.Date());
// String ApprovedT2 = dashdate.format(new java.util.Date());
// String ApprovedT1=" ";
//String ApprovedT2="";*/
String ApprovedT1= dashdate.format(new java.util.Date());
out.println (ApprovedT1);
String ApprovedT2=dashdate.format(new java.util.Date());
out.println(ApprovedT2);
String Indentdate=(dashdate.format(slashdate.parse(request.getParameter("dateindent").trim())));
out.println(Indentdate);
String Cocode ="BML001";
out.println(Cocode);
String Deptcode = request.getParameter("dept1");
out.println(Deptcode);
String Empcode = request.getParameter("emp");
out.println(Empcode);
String Refno =request.getParameter("rtype");
out.println(Refno);
String Divcode = request.getParameter("todiv1");
out.println(Divcode);
String Usercode = "CIRIUS";
String Whcode = request.getParameter("stor");
out.println(Whcode);
// String Itemgroupcode = request.getParameter("");
String Itemgroupcode ="120000";
out.println(Itemgroupcode);
String Supplytypecode = request.getParameter("stype");
out.println(Supplytypecode);
String Delcode = request.getParameter("deliverycode");
out.println(Delcode);
String Itemclass="WS";
out.println(Itemclass);
// String Itemclass = request.getParameter("iclass");
// out.println(Itemclass);
String unitcode = request.getParameter("uni");
out.println(unitcode);
String Todivcode = request.getParameter("todiv1");
out.println(Todivcode);
String Appxrate = request.getParameter("rate");
out.println(Appxrate);
String Srno = request.getParameter("srno");
out.println(Srno);
/* String Indqty = request.getParameter("indentqty");
out.println(Indqty);*/
String Itemcode = request.getParameter("itmcd");
out.println(Itemcode);
String Othersp = request.getParameter("remark1");
out.println(Othersp);
String Reqdt = request.getParameter("dor");
out.println(Reqdt);
String Munitcode = request.getParameter("mcode");
out.println(Munitcode);
String Packqty = request.getParameter("packqty");
out.println(Packqty);
String Packuom = request.getParameter("pack");
out.println(Packuom);
String Remark2 = request.getParameter("remark2");
out.println(Remark2);
String BC = request.getParameter("bcc");
out.println(BC);
String CC = request.getParameter("ccc");
out.println(CC);
try{
st=connection.createStatement();
connection.setAutoCommit(false);
String sql="INSERT INTO PTXNINDHDR(COCODE,DEPTCODE,EMPCODE,APPROVEDT1,APPROVEDT2,INDDT,ENTRYNO,REFNO,REMARKS,DIVCODE,USERCODE,WHCODE,ITEMGROUPCODE,SUPTYPECODE,DELCODE,UNITCODE,TODIVCODE,ITEMCLASS)VALUES('"+Cocode+"','"+Deptcode+"','"+Empcode+"','"+ApprovedT1+"','"+ApprovedT2+"','"+Indentdate+"',"+Entryno+",'"+Refno+"','"+Othersp+"','"+Divcode+"','"+Usercode+"','"+Whcode+"','"+Itemgroupcode+"','"+Supplytypecode+"','"+Delcode+"','"+unitcode+"','"+Todivcode+"','"+Itemclass+"')";
out.println(sql);
st.addBatch(sql);
for(int i=0;i<serials.size();i++){
out.println("Inside the Statement");
String query3="test query for u";
out.println(query3);
String queryx="Insert into PTXNINDDTL(APXRATE,ENTRYNO,BRKNO,INDQTY,ITEMCODE,OTHERSPFCS,MUNITCODE,PACKQTY,PACKUOM,REMARKS,DIMSUBGRPCODE,DIMCODE,REQDT)VALUES("+arate.get(i)+","+entryno+","+srname.get(i)+","+iqnty.get(i)+","+itcode.get(i)+",'"+Othersp+"','"+mucode.get(i)+"',"+pqnty.get(i)+",'"+puom1.get(i)+"','"+remarkss.get(i)+"','"+bcs.get(i)+"','"+ccs.get(i)+"','"+rdate.get(i)+"')";
out.println(queryx);
st.addBatch(queryx);
int[] result=st.executeBatch();
connection.commit();
for(int k=0;k<result.length;k++)
out.println("rows updated by "+(k+1)+"insert sta:"+result[k]+"");
catch(BatchUpdateException bue)
out.println("error1;"+bue+"");
catch(SQLException sql)
out.println("error2;"+sql+"");
catch(Exception l)
out.println("error3;"+l+"");
</html>
Now I looking for to retrieve this footer section data available in multiple rows from footer table and present it in jsp page .
I am finding difficulties in how to show this multiple row data for dynamic no of rows .i.e. variable no. of rows.
I have able to show the data in Header portions of page in this ways
here i am adding the part of code which shows the data from header part of table i.e from Header table
<html>
<h2 align="center"><b>Indent Preparation</b></h2>
<div align="left">
<table width="849" border="0" cellspacing="3" cellpadding="3" align="center">
<tr>
<td ><div align="left"><b>Indent No.</b></div></td>
<td ><label>
<input name="indentno" type="text" id="indentno" size="15" value="" /><input type="hidden" name="no" id="no">
</label></td>
<td ><div align="center"><strong>Indent Date</strong></div></td>
<td ><label>
<div align="center">
<input name="dateindent" type="text" id="dateindent"value="<%=date1%>"/><input type="hidden" name="no" id="no">
</div>
</label></td>
<td> </td>
<td><div align="right"><strong>Entry No.</strong></div></td>
<%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
<td><input type="text" value="<%=hdrcode.get(3)%>" size="10"></td>
<%}else{%>
<td><input type="text" name="entryno" id="entryno" value="<%=entryNo%>"/></td>
<%}%>
<div align="right"></div>
</tr>
<tr>
<td><b>Division</b></td>
<%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
<td><input type="text" value="<%=hdrdetails.get(9)%>" size="20"</td>
<td><input type="hidden" name="div1" id="div1" value='<%=hdrcode.get(10)%>'></td>
<%}else{%>
<td><input type="text" name="div" id="div" /></td>
<td><input type="hidden" name="div1" id="div1" /> </td>
<%}%>
<td> </td>
<td> </td>
<td><div align="right"><strong>Unit</strong></div></td>
<%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
<td><input type="text" value="<%=hdrdetails.get(14)%>" size="20"</td>
<td><input type="hidden" name="uni" id="uni" value='<%=hdrcode.get(12)%>'></td>
<%}else{%>
<td><input type="text" name="unit" id="unit" /></td>
<td><input type="hidden" name="uni" id="uni" /> </td>
<%}%>
</tr>
<tr>
</html>
Any suggestion on any above works is highly appreciated.
Thanks and regards
harshalToo much code. It's also not well intented nor formatted. I don't see a question either or it got lost in that heap of unformatted code.
I will only answer the question in the thread's subject:
How to retrieve multiple data from table and represent it in jsp pageTo retrieve, make use of HttpServletRequest#getParameterValues() and/or #getParameter().
To display, make use of JSTL's c:forEach. -
Hi Planning installation Gurus,
Did u get any luck to resolve this problem as i am also facing same problem "Error creating instance" during install of Planning 9.3.1. i tried 30-50 times reconfiguration every time same problem..
OS: Vista Premium
SQL Server 2005
Essbase:9.3.1
Error Message: "System Failure: Error while retrieving xml file from database"
Details of error:::::::::::::::::::::::::
at com.hyperion.planning.event.HspSysExtChangeHandler.run(Unknown Source
Can not get JDBC connection for SYS external changed actions.
Can not get JDBC connection.
java.lang.NullPointerException
at com.hyperion.planning.sql.HspSQLImpl.getConnection(Unknown Source)
at com.hyperion.planning.event.HspSysExtChangeHandler.actionPoller(Unkno
wn Source)
at com.hyperion.planning.event.HspSysExtChangeHandler.run(Unknown Source
Can not get JDBC connection for SYS external changed actions.
Can not get JDBC connection.
java.lang.NullPointerException
at com.hyperion.planning.sql.HspSQLImpl.getConnection(Unknown Source)
at com.hyperion.planning.event.HspSysExtChangeHandler.actionPoller(Unkno
wn Source)
at com.hyperion.planning.event.HspSysExtChangeHandler.run(Unknown Source
Can not get JDBC connection for SYS external changed actions.
Can not get JDBC connection.
Pls provide SolutionHi John,
though i am trying with SQl server authentication with different user but still status is same of planningSystemDB.properties
SYSTEM_DB_DRIVER=hyperion.jdbc.sqlserver.SQLServerDriver
SYSTEM_DB_URL=jdbc:hyperion:sqlserver://neeraj-PC:1433
SYSTEM_DB_USER=windowsAuthentication
SYSTEM_DB_PASSWORD=CAFBAEFNBGEAABHEDOADFKADACBGBIFHBLCDFBAFFH
SYSTEM_DB_CATALOG=plandb
SYSTEM_DB_TYPE=SQL
INSTANCE=
my steps:
Using SQL Server Management Studio
Changed Widows authentication to SQL server authentication mode
In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.
On the Security page, under Server authentication, select the new server authentication mode, and then click OK.
In the SQL Server Management Studio dialog box, click OK to acknowledge the requirement to restart SQL Server.
In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.
On the Security page, under Server authentication, select the new server authentication mode, and then click OK.
In the SQL Server Management Studio dialog box, click OK to acknowledge the requirement to restart SQL Server.
To restart SQL Server from SQL Server Management Studio
To enable the sa login by using Management Studio
In Object Explorer, expand Security, expand Logins, right-click sa, and then click Properties.
On the General page, you might have to create and confirm a password for the sa login.
On the Status page, in the Login section, click Enabled, and then click OK.
In Object Explorer, expand Security, expand Logins, right-click sa, and then click Properties.
On the General page, you might have to create and confirm a password for the sa login.
On the Status page, in the Login section, click Enabled, and then click OK.}}}
anything else should i change................. -
Hi S9 installation Gurus,
Please try to resolve this long awaited issue with Planning installation as this is purely configuration related issue.
Detail of Problem:-
After Susessful configuration of
1) Foundation Services (Hyperion Shared Services)
2) Essbase administration services
3) Essbase Server
4) Hyperion reporting and analysis
5) Planning -----> Product options, Register with shared services, configure database, deploy to application server (Appache)
Error Point: when i tick ckeck box in front of Product instance registration
click next
create instance
click next
instance name-Plan1
Web tier host name: my machine name (neeraj-pc, as i installed locally all component of hyperion)
server port: 8300 (system suggesting)
tick on active instance
click next
Error Pop Up "System Failure: Error while retrieving xml file from database"
Details of PlanningSystemDB (file :- \Hyperion\common\config\PlanningSystemDB.properties)
SYSTEM_DB_DRIVER=hyperion.jdbc.sqlserver.SQLServerDriver
SYSTEM_DB_URL=jdbc:hyperion:sqlserver://neeraj-PC:1433
SYSTEM_DB_USER=puser
SYSTEM_DB_PASSWORD=GGAKFJ
SYSTEM_DB_CATALOG=p1db
SYSTEM_DB_TYPE=SQL
INSTANCE=
Note: puser (SQL Authenticated user)
Thanks
Kumar
Edited by: user10385300 on Dec 4, 2008 5:44 AMThis has been resolved at :- Product Instance Registration Error Message: "System Failure: Error while retrieving xml file from database"
Cheers
John
http://john-goodwin.blogspot.com/ -
How can I Retrieve special chars from a HTTP Request??
Hi,
I want to retrieve special chars from a request
Chars like accents used in spanish languages or symbols?
Is there any way to do it
Thanks in advance
Alejandro ArredondoThis is my problem
For example:
This is my form:
<form>
<input type="text" name="test">
</form>
I do write a char on the text area. Something like "?" or "?"
or some words with accents
When I retrieve the value with
String value = request.getParameter("test");
and print it
out.println("TEST= " + test);
It prints another symbol that isn't the one I sent in my form.
why?
Thanks
Maybe you are looking for
-
Dúvida no cancelamento de uma NFe Rejeitada
Boa tarde a todos, Estou com uma dúvida quanto ao processo de cancelamento de uma NFe rejeitada e agradeço antecipadamente a colaboração dos colegas aqui do forum que possam ter passado por situação semelhante. Temos o seguinte cenário: implementação
-
using the lync client connectivity tester on a pc on the same lan as my mobile client everything is green and it says its ready for use. using my android galaxy s5 client on wifi on the same lan i get a screen with waiting to sign in spinning and an
-
Uploading photos to photobox.co.uk
When I upload photos to Photobox.co.uk, the photos revert to their pre-edited state. So if I have 'enhanced' a photo, the improvements are then lost. Help!
-
Unable to install UPK - get error while loading library
Hi, I have installed UPK 11.0. I get an error when I start the Developer Client. "Unable to connect to remote server. Verify the webserver and database server are running" I have followed the install steps and have updated the profile, library locati
-
Hi All, I am getting the error while loading data from Ascential. There is red color error request in PSA and yellow color string in Request update column. The error message in Details Tab Is : Error in Data Request When I click on the messages it