Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
JSP
give another jsp to action
anarkali perera
Ranch Hand
Posts: 237
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
this is my
jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!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>Insert title here</title> </head> <body> <bboy color="red"> <form action="MySession" method="get"> <table> <tr><input type="text" name="name"></tr> <tr><input type="text" name="naddress"></tr> <tr><input type="text" name="age"></tr> <jsp:useBean id="one" class="MyServlet.MyBean" scope="session"> <jsp:setProperty name="one" property="name" param="name" /> <jsp:setProperty name="one" property="age" param="age" /> <jsp:setProperty name="one" property="address" param="address" /> </jsp:useBean> <tr><input type="submit" name="submit" value="submit"></tr> </table> </form> </body> </html>
i need to send this bean another jsp.where should i declare that jsp?
Sagar Rohankar
Ranch Hand
Posts: 2908
1
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Define the another JSP wherever in the context (from where it is accessible) and try using the bean like this:
<jsp:useBean id="one" class="MyServlet.MyBean" scope="session"> <jsp:getProperty name="one" property="name" /> </jsp:useBean>
[LEARNING bLOG]
|
[Freelance Web Designer]
|
[and "Rohan" is part of my surname]
anarkali perera
Ranch Hand
Posts: 237
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
ok.but i need to know when i click the submit button it should go to another jsp.how to do that?
Sagar Rohankar
Ranch Hand
Posts: 2908
1
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Try,
<form action="another.jsp" method="get">
[LEARNING bLOG]
|
[Freelance Web Designer]
|
[and "Rohan" is part of my surname]
David Newton
Author
Posts: 12617
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
(With the caveat that submitting to JSPs is considered poor practice.)
anarkali perera
Ranch Hand
Posts: 237
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
can i map a jsp using Deployment Discripter.
as example this is the way we map
servlet
<servlet-mapping> <servlet-name>HelloWorld12</servlet-name> <url-pattern>/HelloWorld</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>MySession</servlet-name> <url-pattern>/MySession</url-pattern> </servlet-mapping>
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Please Consider David input.
For Your Information
http://wiki.metawerx.net/wiki/Web.xml.JspFile
anarkali perera
Ranch Hand
Posts: 237
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
<servlet> <servlet-name>jsptester</servlet-name> <jsp-file>showpath.jsp</jsp-file> </servlet> <servlet-mapping> <servlet-name>jsptester</servlet-name> <url-pattern>/tester/*<url-pattern> </servlet-mapping>
in this example what is mean by tester/* .it is mean all url that include tester
word
?
Sagar Rohankar
Ranch Hand
Posts: 2908
1
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Please check the same link, its shows which URL
pattern
call that servlet mapping.
[LEARNING bLOG]
|
[Freelance Web Designer]
|
[and "Rohan" is part of my surname]
anarkali perera
Ranch Hand
Posts: 237
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
this is my one jsp file
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <body> <form action="result.jsp" method="get"> <table> <tr>name<input type="text" name="name"></tr> <tr>address<input type="text" name="naddress"></tr> <tr>age<input type="text" name="age"></tr> <jsp:useBean id="one" class="MyServlet.MyBean" scope="session"> <jsp:setProperty name="one" property="name" param="name" /> <jsp:setProperty name="one" property="age" param="age" /> <jsp:setProperty name="one" property="address" param="address" /> </jsp:useBean> <tr><input type="submit" name="submit" value="submit"></tr> </table> </form> </body> </html>
this is the jsp which i use print get to bean values.
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!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>Insert title here</title> </head> <body> name is <jsp:getProperty property="name" name="one"/> </body> </html>
but when i run first jsp it gives this error?
HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Attempted a bean operation on a null object. org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty(JspRuntimeLibrary.java:603) org.apache.jsp.result_jsp._jspService(result_jsp.java:62) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs. -------------------------------------------------------------------------------- Apache Tomcat/6.0.18
anarkali perera
Ranch Hand
Posts: 237
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
this is the which print on server
Oct 16, 2009 8:25:32 AM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:jspFirst' did not find a matching property. Oct 16, 2009 8:25:32 AM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.6.0\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.6.0/bin/client;C:/Program Files/Java/jre1.6.0/bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\jdk1.6.0\bin;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.16\lib\servlet-api.jar;C:\Program Files\Common Files\Ulead Systems\MPEG;C:\Program Files\Rational\common;C:\Documents and Settings\aruna\Desktop\mysql-connector-java-5.1.7;C:\MATLAB7\bin\win32;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\apache-ant-1.7.1\bin;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;n:\vStudio\Common7\IDE\PrivateAssemblies\; Oct 16, 2009 8:25:32 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Oct 16, 2009 8:25:32 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 587 ms Oct 16, 2009 8:25:32 AM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Oct 16, 2009 8:25:32 AM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.18 Oct 16, 2009 8:25:32 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Oct 16, 2009 8:25:32 AM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Oct 16, 2009 8:25:32 AM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/32 config=null Oct 16, 2009 8:25:32 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 413 ms Oct 16, 2009 8:25:39 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: Attempted a bean operation on a null object. at org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty(JspRuntimeLibrary.java:603) at org.apache.jsp.result_jsp._jspService(result_jsp.java:62) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source)
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
please see the Sagar's first post
anarkali perera
Ranch Hand
Posts: 237
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
no.i can't get idia from that?
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
your <jsp:getProperty property="name" name="one"/> is with out jsp:useBean . got it?
anarkali perera
Ranch Hand
Posts: 237
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
is it essential to use <jsp:getProperty property="name" name="one"/> inside the jsp:usebean tag
anarkali perera
Ranch Hand
Posts: 237
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
i chang the result.jsp as foccows.
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!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>Insert title here</title> </head> <body> <jsp:useBean id="one" class="MyServlet.MyBean" scope="session"> name is <jsp:getProperty property="one" name="name"/> </jsp:useBean> </body> </html>
but it don't compile.it says "Unknown type for identifier one.i am use eclips.
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
NULL
calling jsp directl from HTML form
bean value gives null
how to re set a existing bean
include directive doesn't work
More...