JSP forwarding between WML pages
Apparently some (not all) WAP browsers are very strict that the XML tag come first thing, no spaces, no blank lines.
So when I forward from one JSP (which has an XML tag at it's very beginning) to another JSP page (which also has an XML tag at it's very beginning) it creates a problem on older browsers and they complain of the HTTP reply (that's what they call it) being empty.
The forwarded to page is a login page that is never accessed directly, only through forwards, so can I remove the XML tag at the beginning to eleviate this problem?
These browsers are so strict that I can't even place some JSP page tags before the XML as they result in a space or blank line. I love this stuff!
Try to put this code in the top of the jsp, if you didn't do yet.
<%@ page contentType="text/vnd.wap.wml" %>
<?xml version="1.0"?>
Similar Messages
-
Restore Data between multiple pages
Hi All,
I have 3 jsp pages for the registration part.The user can navigate between these pages and finally submit it from the third page.
Now lets say the user enters data on the first page and clicks on Next to go to second page. He enters some more data on second page and now wants to edit the data entered on the first page.
How do I store the values entered by the user in the first page?
In normal struts all the data entered will be in form bean defined.So the data is available.
Please let me know how to handle it using ADF as there is one common Dataform ?
waiting eagerly for the repsone
ThanksIf you get this one figured out, I'd really like to know.
We dropped the bindings on each page (like an Input form), but removed the unnecessary bindings. We created an event_Next button and event_Previous buttons as well as a [Save] and [Cancel] button.
The forwards between the pages would call a method in the DataForwardACtion for the page, i.e. onNext. The only action we'd do in there was a Commit. (we didn't want to lose anything). However, all of our validation was done inside Struts Validator with custom extensions. This is probably not the route you are supposed to go with ADF as validation should be occurring at the entity, but it was at least "workable" for now. As we learn more about things, we'll probably revisit this. -
Hi there,
Here's what I got:
1. a form to input data.
2. the data is submited to a processing jsp
3. the processing jsp forwards to anohter page. here's my forwarding syntax:
<jsp:forward page="PicView.jsp">
<jsp:param name="photoID" value="8987"/>
<jsp:param name="SGID" value="5642"/>
</jsp:forward>
What I want:
upon forwarding I want to move down the page to an anchor. So the end URL should goto:
PicView.jsp?photoID=8987&SGID=5642#photo
Can I add the "#photo" to the <jsp:forward> tag somehow??
JoelMac*** in your JSP ***
<jsp:forward page="PicView.jsp">
<jsp:param name="photoID" value="8987"/>
<jsp:param name="SGID" value="5642"/>
<jsp:param name="where" value="#photo" />
</jsp:forward>
*** in PicView.jsp ***
<%
String s = request.getParameter("where");
if ( s != null )
out.println("<script>");
out.println("window.location.href = \"" + s + "\";");
out.println("</script>");
%>
If you know that "where" will never be null then you can simplify this to:
<script>
window.location.href = "<%= where %>" ;
</script> -
Differentiate between oa page and iStore page(jsp)
Hi,
How to Differentiate between OA page and iStore pages?If the URL contains the JSP tag as OA.jsp or RF.jsp, then its an OAF application else if you see some custom jsp, eg, jftchrome.jsp etc, then the application is JTT/JTF based application:
eg:
OAF application:
http://sampledomain.oracle.com:5000/OA_HTML/*OA.jsp*?.......
http://sampledomain.oracle.com:5000/OA_HTML/*OA.jsp*?.......
JTT Application
http://sampledomain.oracle.com:5000/OA_HTML/*jtfchorme.jsp*?....... -
Getting Java var on second page without JSP:Forward
Hi all ..
My friend has asked a question....
So
i want to get a Java variable on the second page
with out using Session or Jsp forwarding.
I hav use Request Dispatcing this eork only in Jsp forwrding scheme.
I wan to access a java variable on the submittion of first page.
Plz guide me.
Thanks in advanceYoGee, I think that would still involve forwardingI don't think so. If the user posts the form from the
first jsp ("submittion of first page") you don't need
to do a forward.You cant pass a Vector through a form. You need to set it
in the request and then either forward or include the 2nd
page.. that or set it in the session or application scope
and redirect to the next page. -
Distinguishing between bookmark page and ordinary jsp
If I bookmark a page in my project and close the browser , and again on restarting the browser
viewing the same bookmark page without logging in,
All the links should work.
It is working , but problem arises here
how to
distinguish between bookmark page and ordinary jsp
which is viewed with loginThe problem is not the bookmark.
Review your JSP, you may find it does not check the session id.
In this case, everyone can access the page without login. -
three finger or two finger gesture to move back and forward between pages of file only work on safari, unlike with old os. this new lion won't let me do it. Any help?
I have decided to dedicate this thread to the wonderful errors of Lion OSX. Each time I find a huge problem with Lion I will make note of it here.
Today I discovered a new treasure of doggie poop in Lion. No Save As......
I repeat. No Save As. In text editor I couldn't save the file with a new extension. I finally accomplished this oh so majorly difficult task (because we all know how difficult it should be to save a file with a new extension) by pressing duplicate and then saving a copy of the file with a new extension. Yet then I had to delete the first copy and send it to trash. And of course then I have to secure empty trash because if I have to do this the rest of my mac's life I will be taking up a quarter of percentage of space with duplicate files. So this is the real reason they got rid of Save As: so that it would garble up some extra GB on the ole hard disk.
So about 20 minutes of my time were wasted while doing my homework and studying for an exam because I had to look up "how to save a file with a new extension in mac Lion" and then wasted time sitting here and ranting on this forum until someone over at Apple wakes up from their OSX-coma.
are you freaking kidding me Apple? I mean REALLY?!!!! who the heck designed this?!!! I want to know. I want his or her name and I want to sit down with them and have a long chat. and then I'd probably splash cold water on their face to wake them up.
I am starting to believe that Apple is Satan. -
Difference between jsp:forward sendRedirect and jsp include directive
Am very much confused, please explain me the difference between
jsp:forward sendRedirect and jsp include directive with a suitable example.
I'll be very gratefull. Its very urgent.One basic difference. The include executes in the .jsp servelet created. The redirect transfers "control" by redirecting the client request to another destination. In other words, the current .jsp is no longer in charge or in the calling chain in any way.
-
Difference between jsp forward tag and sendRedirect
I would like to know the difference between jsp forward tag and sendRedirect.
Please explain with a suitable example if possible ...
glennSee: http://java.oreilly.com/news/jsptips_1100.html (number 4)
-
Difference between jsp forward action tag and response.forward()
hi guys
i have just started programming using j2ee technology.
could anyone please tell me what is the difference between the jsp forward action tag and froward method using the response object?There really isn't one. The JSP forward tag is a convenience tag for JSP, that uses the response method.
-
Difference between jsp:forward and logic:forward
Hi,
Can anyone let me know??
what is the difference between <jsp:forward> in and <logic:forward> in struts
Thanks in advance,
Regards
Dhinesh kumar RSee: http://java.oreilly.com/news/jsptips_1100.html (number 4)
-
Can a .jsp contain more then one jsp:forward page
Can a .jsp contain more then one jsp:forward page if it's conditional.
ie. if condition true
forward to pageA
else
forward to pageB?
Thank you.gimbal2,
Thanks for the response. I did try it and I got a
compile error. I just realized that the error was
regarding a different issue.
JJIn that case, it would have been appropriate to post the actual problem. -
I would like to show my code, because i'm not sure what u mean at the moment...i want to display the error message on the registration.jsp page and not on a new page...
registration.jsp:
<HTML>
<HEAD>
<TITLE>New Player</TITLE>
<content = "registration.html">
<LINK REL=stylesheet TYPE="text/css" HREF="style.css">
<SCRIPT>
function validateText(regForm)
if(regForm.firstName.value=="")
return false;
if(regForm.surname.value=="")
return false;
if(regForm.email.value=="")
return false;
if(regForm.teamName.value=="")
return false;
if(regForm.pass1.value=="")
return false;
if(regForm.pass2.value=="")
return false;
return true;
function validatePass(regForm)
if(regForm.pass1.value!==regForm.pass2.value)
return false;
return true;
function validatePassw(regForm)
var pWord = regForm.pass1.value;
if(pWord.length > 8)
return false;
else if(pWord.length < 4)
return false;
return true;
function validateTeamn(regForm)
var tName = regForm.teamName.value;
if(tName.length > 15)
return false;
return true;
function validateEmail(email)
var result = false
var theStr = new String(email)
var index = theStr.indexOf("@");
if (index > 0)
var pindex = theStr.indexOf(".",index);
if ((pindex > index+1) && (theStr.length > pindex+1))
result = true;
return result;
function doSubmit(regForm)
if(validateText(regForm)==false)
alert("Please complete all text fields");
return false;
else if (!validateEmail(regForm.email.value))
alert("Please enter email address in the form: [email protected]");
return false;
else if(validateTeamn(regForm)==false)
alert("Team Name too long");
return false;
else if(validatePass(regForm)==false)
alert("Passwords did not match, please retype password");
return false;
else if(validatePassw(regForm)==false)
alert("Incorrect password length, please retype password");
return false;
//alert("Your details are being submitted");
//return;
</SCRIPT>
</HEAD>
<BODY>
<FONT size=4>
Please enter the following information in the space provided below:
</FONT>
<CENTER>
<FORM NAME="regForm" ACTION="confirm.jsp" METHOD=POST onSubmit="return doSubmit(regForm);">
<B><U>Personal Details:</U></B><BR>
<FONT SIZE=2 color="blue">(Your Team Name should be no more than 15 characters long<BR>
& Your Password should be between 4-8 characters)</FONT><BR>
<TABLE>
<TR>
<TD ALIGN="right">
First Name:
</TD>
<TD ALIGN="left">
<INPUT TYPE="text" SIZE=20 NAME="firstName">
</TD>
</TR>
<TR>
<TD ALIGN="right">
Surname:
</TD>
<TD ALIGN="left">
<INPUT TYPE="text" SIZE=20 NAME="surname">
</TD>
</TR>
<TR>
<TD ALIGN="right">
Email Address:
</TD>
<TD ALIGN="left">
<INPUT TYPE="text" SIZE=20 NAME="email">
</TD>
</TR>
<TR>
<TD ALIGN="right">
Team Name:
</TD>
<TD ALIGN="left">
<INPUT TYPE="text" SIZE=20 MAXLENGTH=30 NAME="teamName">
</TD>
</TR>
<TR>
<TD ALIGN="right">
Password:
</TD>
<TD ALIGN="left">
<INPUT TYPE="password" SIZE=8 MAXLENGTH=20 NAME="pass1">
</TD>
</TR>
<TR>
<TD ALIGN="right">
Re-enter Password:
</TD>
<TD ALIGN="left">
<INPUT TYPE="password" SIZE=8 MAXLENGTH=15 NAME="pass2">
</TD>
</TR>
</TABLE>
<INPUT TYPE="submit" VALUE="Register">
<INPUT TYPE="reset" VALUE="Clear Form">
</FORM>
</CENTER>
</BODY>
</HTML>
confirm.jsp:
<html>
<head>
<basefont face="Arial">
</head>
<body>
<center>
<%@ page language="java" import="java.sql.*" %>
<%
// load driver
Class.forName("org.postgresql.Driver");
// create connection url
String URL = "jdbc:postgresql://dbhost/ug59sxn";
// pass database parameters to JDBC driver
Connection Conn = DriverManager.getConnection(URL, "ug59sxn", "hupeswop");
boolean verify = false;
String email;
String email2;
email = request.getParameter("email");
// query statement
Statement SQLStatement = Conn.createStatement();
// generate query
String Query = "SELECT email FROM usertable " +
"WHERE email = '"+email+"'";
// get result
ResultSet SQLResult = SQLStatement.executeQuery(Query);
// check for email
while(SQLResult.next())
email2 = SQLResult.getString(1);
if(email.equalsIgnoreCase(email2))
verify=true;
out.println("email already exists, please type another one");
if(verify==false)
%>
<jsp:forward page="reg2.jsp"></jsp:forward>
<%
// close connections
SQLResult.close();
SQLStatement.close();
Conn.close();
%>
</center>
</body>
</html>
So what u r saying..i should put into my confirm.jsp -
%>
<jsp:forward page="registration.jsp">
<jsp:param name="errorMessage" value="Email already exist" />
</jsp:forward>
<%
but the part where i'm abit confused, what am i supposed to put in the registration.jsp page?
thanx for the help in advance.Hi,
In confirm.jsp You can put the error message in a header with response.setAttribute(sMsg, "Please type proper values"); or you can put it in session or cookie.
And get this information in the regestration.jsp and display it. -
Hello everybody, sorry for my bad english.
Finally, I let my old post to ask my question differently:
Is it possible, with ADF, to start the application like this:
in web.xml:
<welcome-file>index.jsp</<elcome-file>
in index.jsp:
<jsp:forward page="/home.jsf"/>
Because personally, the only method I found is:
in web.xml:
<welcome-file>index.jspx</welcome-file>
with the appropriated configuration in web.xml (particularly a filter implemented manually).
If the answer to my question is yes, please, is it possible to see you web.xml file?
Thanks in advance.Thanks for your answer.
In fact, nothing is bad with:
<welcome-file>/home.jsf</welcome-file>
But know if it is possible to use <jsp:forward page="/home.jsf"> could maybe help me to understand some things about the use of filters.
Personally, as I said before, I can effectively use <welcome-file>/home.jsf</welcome-file> but this implies to implement a filter.
In others libraries (even with Trinidad), this filter is never needed.
So, I try to understand the difference between those two methods.
And any information about this interest me.
Thanks in advance. -
Problem while redirecting from servlet to wml page
Hello everybody
I am developing a WAP site but I am a begnner in wml and servlet. So I need some help from you ppl.
I have made a wml page whch redirects to a Login servlet now from that LoginServlet I want to gain redirect to a wml page. I have written the following code so that when the user clicks on Login he is redirected to emailreaderwap/Login.wml page
PrintWriter out = response.getWriter();
String url="/emailreaderswap/login.wml";
response.addHeader("Content-Location:", Double.toStringMath.random()));
response.setContentType("text/vnd.wap.wml");
out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?> ");
out.println("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.3//EN\" ");
out.println("\"http://www.wapforum.org/DTD/wml13.dtd\"> ");
out.println("<wml>");
out.println("<card>");
out.println("<p>"+ "Email Address or Password are wrong Please Try Again!\r\nClick On The Link Below to go back to Login Page"+
"<a href=\""+url+"\">Login</a>");
out.println("</p>"+"</card>"+"</wml>");But when I run this in my Nokia Mobile Browser4.0 I get "malformed output" as output whereas I want to see the /emailreaderwap/Login.wml page as the output.
Please tell me whether this is the right way to go abt it or is there any other way i can accomplish my task.
I hope you ppl reply as soon as possible as I have a deadlne to meet.
Eagerly waiting for your reply.
Thankyou
Heti Shahhi ,
u forgot to give the slash ("/") before jsp file when u r creating the RequestDispatcher object. I tried the following example. Its working fine.
check this code:
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.GenericServlet;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
* @author sivakumar
public class TestServlet extends GenericServlet {
public void service(ServletRequest request,ServletResponse response)throws ServletException,IOException{
PrintWriter out=response.getWriter();
response.setContentType("text/html");
out.println("Hi this is first servlet");
RequestDispatcher requestDispatcher=getServletContext().getRequestDispatcher("/test.jsp");
requestDispatcher.forward(request,response);
}test.jsp shows images also.
try it...
good luck...
Maybe you are looking for
-
My late 2011 MBP has been randomly restarting lately. Very frustrating. Can anyone tell me what the problem is? Is it a kernal panic, and if so what can I do about it? I have included the error report below. Thanks! Interval Since Last Panic Report:
-
Problem changing XML element in Adapter Module
Hey! I am developing an adapter module to transform a coded password back to clear text. I have access to the XML element where the password is and I get to transform it, but I have 2 problems as also stated in the code: 1) I cannot set the new value
-
How to include a custom Tx code in easy access?
Hello friends, I have created 3 custom Txcodes and i have been able to include them in SAP easy access page. But i want to include separate folder as EMPID under logistics and then include my three Txcodes can anyone help me with t
-
Release strategy for PO and RO
Hi All My release strategy for Purchase order and Release Order is same.My release strategy has material group and PO/RO value as characteristics. What I want is that my releaase strategy for PO should be based on value whereas for RO it should be ba
-
Third party memory upgrades?
Hi, I'm in the process of upgrading the memory in my USB 2.0 iMac and was wondering if anyone had experience with using non OEM modules. In my case, the price is not the only factor deterring me from making a purchase directly from Apple. After placi