This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes how to  send bean objct to another jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "how to  send bean objct to another jsp" Watch "how to  send bean objct to another jsp" New topic
Author

how to send bean objct to another jsp

Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
i need to send bean objct to another jsp
here is my jsp


this is the jsp i need to get the bean object


INFO: classLoader = WebappClassLoader
delegate: true
repositories:
WEB-INF/classes/
----------> Parent Classloader:
org.glassfish.internal.api.DelegatingClassLoader@1eb1db2
INFO: SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@15a142f
INFO: Unknown loader org.glassfish.internal.api.DelegatingClassLoader@1eb1db2 class org.glassfish.internal.api.DelegatingClassLoader
INFO: Loading application First at /First
INFO: Deployment of First done is 360 ms
INFO: classLoader = WebappClassLoader
delegate: true
repositories:
WEB-INF/classes/
----------> Parent Classloader:
org.glassfish.internal.api.DelegatingClassLoader@1eb1db2
INFO: SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@15a142f
INFO: Unknown loader org.glassfish.internal.api.DelegatingClassLoader@1eb1db2 class org.glassfish.internal.api.DelegatingClassLoader
INFO: Loading application First at /First
INFO: Deployment of First done is 797 ms
INFO: classLoader = WebappClassLoader
delegate: true
repositories:
WEB-INF/classes/
----------> Parent Classloader:
org.glassfish.internal.api.DelegatingClassLoader@1eb1db2
INFO: SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@15a142f
INFO: Unknown loader org.glassfish.internal.api.DelegatingClassLoader@1eb1db2 class org.glassfish.internal.api.DelegatingClassLoader
INFO: Loading application First at /First
INFO: Deployment of First done is 156 ms
INFO: classLoader = WebappClassLoader
delegate: true
repositories:
WEB-INF/classes/
----------> Parent Classloader:
org.glassfish.internal.api.DelegatingClassLoader@1eb1db2
INFO: SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@15a142f
INFO: Unknown loader org.glassfish.internal.api.DelegatingClassLoader@1eb1db2 class org.glassfish.internal.api.DelegatingClassLoader
INFO: Loading application First at /First
INFO: Deployment of First done is 188 ms
INFO: classLoader = WebappClassLoader
delegate: true
repositories:
WEB-INF/classes/
----------> Parent Classloader:
org.glassfish.internal.api.DelegatingClassLoader@1eb1db2
INFO: SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@15a142f
INFO: Unknown loader org.glassfish.internal.api.DelegatingClassLoader@1eb1db2 class org.glassfish.internal.api.DelegatingClassLoader
INFO: Loading application First at /First
INFO: Deployment of First done is 172 ms
INFO: classLoader = WebappClassLoader
delegate: true
repositories:
WEB-INF/classes/
----------> Parent Classloader:
org.glassfish.internal.api.DelegatingClassLoader@1eb1db2
INFO: SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@15a142f
INFO: Unknown loader org.glassfish.internal.api.DelegatingClassLoader@1eb1db2 class org.glassfish.internal.api.DelegatingClassLoader
INFO: Loading application First at /First
INFO: Deployment of First done is 203 ms
INFO: classLoader = WebappClassLoader
delegate: true
repositories:
WEB-INF/classes/
----------> Parent Classloader:
org.glassfish.internal.api.DelegatingClassLoader@1eb1db2
INFO: SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@15a142f
INFO: Unknown loader org.glassfish.internal.api.DelegatingClassLoader@1eb1db2 class org.glassfish.internal.api.DelegatingClassLoader
INFO: Loading application First at /First
INFO: Deployment of First done is 500 ms
INFO: classLoader = WebappClassLoader
delegate: true
repositories:
WEB-INF/classes/
----------> Parent Classloader:
org.glassfish.internal.api.DelegatingClassLoader@1eb1db2
INFO: SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@15a142f
INFO: Unknown loader org.glassfish.internal.api.DelegatingClassLoader@1eb1db2 class org.glassfish.internal.api.DelegatingClassLoader
INFO: Loading application First at /First
INFO: Deployment of First done is 172 ms
INFO: classLoader = WebappClassLoader
delegate: true
repositories:
WEB-INF/classes/
----------> Parent Classloader:
org.glassfish.internal.api.DelegatingClassLoader@1eb1db2
INFO: SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@15a142f
INFO: Unknown loader org.glassfish.internal.api.DelegatingClassLoader@1eb1db2 class org.glassfish.internal.api.DelegatingClassLoader
INFO: Loading application First at /First
INFO: Deployment of First done is 204 ms
INFO: classLoader = WebappClassLoader
delegate: true
repositories:
WEB-INF/classes/
----------> Parent Classloader:
org.glassfish.internal.api.DelegatingClassLoader@1eb1db2
INFO: SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@15a142f
INFO: Unknown loader org.glassfish.internal.api.DelegatingClassLoader@1eb1db2 class org.glassfish.internal.api.DelegatingClassLoader
INFO: Loading application First at /First
INFO: Deployment of First done is 203 ms
INFO: classLoader = WebappClassLoader
delegate: true
repositories:
WEB-INF/classes/
----------> Parent Classloader:
org.glassfish.internal.api.DelegatingClassLoader@1eb1db2
INFO: SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@15a142f
INFO: Unknown loader org.glassfish.internal.api.DelegatingClassLoader@1eb1db2 class org.glassfish.internal.api.DelegatingClassLoader
INFO: Loading application First at /First
INFO: Deployment of First done is 187 ms
SEVERE: StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: PWC6049: Attempted a bean operation on a null object.
at org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty(JspRuntimeLibrary.java:644)
at org.apache.jsp.test.Dispathcher_jsp._jspService(Dispathcher_jsp.java from :58)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:403)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:366)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:431)
at org.apache.catalina.core.StandardWrapperValve.preInvoke(StandardWrapperValve.java:462)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:139)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:186)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:142)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:242)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
at com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
at com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:570)
at com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:827)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
at com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:71)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
at com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
SEVERE: StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: PWC6049: Attempted a bean operation on a null object.
at org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty(JspRuntimeLibrary.java:644)
at org.apache.jsp.test.Dispathcher_jsp._jspService(Dispathcher_jsp.java from :58)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:403)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:366)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:431)
at org.apache.catalina.core.StandardWrapperValve.preInvoke(StandardWrapperValve.java:462)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:139)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:186)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:142)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:242)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
at com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
at com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:570)
at com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:827)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
at com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:71)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
at com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
SEVERE: PWC6117: File "C:\Program Files\sges-v3-prelude\glassfish\domains\domain1\docroot\Dispathcher.jsp" not found
SEVERE: PWC6117: File "C:\Program Files\sges-v3-prelude\glassfish\domains\domain1\docroot\Dispathcher.jsp" not found
INFO: classLoader = WebappClassLoader
delegate: true
repositories:
WEB-INF/classes/
----------> Parent Classloader:
org.glassfish.internal.api.DelegatingClassLoader@1eb1db2
INFO: SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@15a142f
INFO: Unknown loader org.glassfish.internal.api.DelegatingClassLoader@1eb1db2 class org.glassfish.internal.api.DelegatingClassLoader
INFO: Loading application First at /First
INFO: Deployment of First done is 438 ms
INFO: classLoader = WebappClassLoader
delegate: true
repositories:
WEB-INF/classes/
----------> Parent Classloader:
org.glassfish.internal.api.DelegatingClassLoader@1eb1db2
INFO: SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@15a142f
INFO: Unknown loader org.glassfish.internal.api.DelegatingClassLoader@1eb1db2 class org.glassfish.internal.api.DelegatingClassLoader
INFO: Loading application First at /First
INFO: Deployment of First done is 688 ms
INFO: classLoader = WebappClassLoader
delegate: true
repositories:
WEB-INF/classes/
----------> Parent Classloader:
org.glassfish.internal.api.DelegatingClassLoader@1eb1db2
INFO: SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@15a142f
INFO: Unknown loader org.glassfish.internal.api.DelegatingClassLoader@1eb1db2 class org.glassfish.internal.api.DelegatingClassLoader
INFO: Loading application First at /First
INFO: Deployment of First done is 188 ms
SEVERE: StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: PWC6049: Attempted a bean operation on a null object.
at org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty(JspRuntimeLibrary.java:644)
at org.apache.jsp.test.Dispathcher_jsp._jspService(Dispathcher_jsp.java from :58)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:403)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:366)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:431)
at org.apache.catalina.core.StandardWrapperValve.preInvoke(StandardWrapperValve.java:462)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:139)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:186)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:142)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:242)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
at com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
at com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:570)
at com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:827)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
at com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:71)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
at com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)


[/code]
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
i try changing my class below


then also i get error


how can i transfer my dog object to another jsp?
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1449
    
    6

Why not simply use forward action?


Swastik
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
i change my class

this jsp file and Dispathcher file are in same folder.
here is error i am getting?

Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1449
    
    6

Look at the error
java.lang.IllegalArgumentException: PWC1222: Path Dispathcher.jsp does not start with a "/" character

but your code says

getRequestDispatcher("Dispathcher.jsp") which should have been getRequestDispatcher("/Dispathcher.jsp")

more over why to go for java code in jsp why not use forward action as I said

Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
ok.thanks
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

And spell "dispatcher" correctly.
 
Consider Paul's rocket mass heater.
 
subject: how to send bean objct to another jsp
 
Similar Threads
Problems Conectiong Database to a WebApplication - Unable to get connection, DataSource invalid
exceptions occurring here
Returning a String from Server (REST) and getting Errors..
Stripes, Spring, JPA, Hibernate, struggling to tie them all together
connectio null problem