[java ee programming] Lab 4003: adding a new parameter to the request object
Hi fellows. I hope everyone is great,busy programming with passion! I'm going through the lab 4003-jsp basics and got a doubt on how to add a new parameter to the request object as asked for in the task. The code is: String username = request.getParameter("username"); if(username != null && username.length>0) then it forwards to another jsp this will display name,hobby...but the question is how to add a new string type parameter to the request,whose value will be displayed by the middle(includes the response.jsp) along with username,hobby,etc. I've tried some sample codes,all unssuccesful. Thanks in advance, VB -- You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en
[java ee programming] lab-4003 cont
The 2nd part of the instructionsThe index.jsp forwards the request to another JSP file called middle.jsp. Before forwarding, it should add another String type parameter called myparameter with value "Passion!" to the request object. The middle.jsp then includes the response.jsp. The response.jsp should display the value of the myparameter along with name and hobby. In the index.jsp I have the following : name, hobby and birthplace. <% String username = request.getParameter("username"); if ( username != null && username.length() > 0 ) { %> <%-- this is my forward statement--%> <% Once I click submit on the page I get the follwing : exception HTTP STATUS 500 org.apache.jasper.JasperException: PWC6033: Unable to compile class for JSP PWC6197: An error occurred at line: 28 in the jsp file: /response.jsp PWC6199: Generated servlet error: string:///middle_jsp.java:72: cannot find symbol symbol : variable username location: class org.apache.jsp.middle_jsp PWC6199: Generated servlet error: Note: string:///middle_jsp.java from uses unchecked or unsafe operations. PWC6199: Generated servlet error: It looks as I have to pass the three parms to the middle.jsp is this correct? It works on the include but not on the forward --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en -~--~~~~--~~--~--~---
[java ee programming] lab-4003
For the Homework In modifying the Hello1 project after doing the first step which says Modify index.jsp and response.jsp to display another item The next step I have to add a JSP, adding another parm - how do I pass the parms to the response.jsp so that it will recognize them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en -~--~~~~--~~--~--~---
[java ee programming] Lab 4003
Hi, I am on hand on lab 4003 in exsercise (2.1) Build and run "JSP Examples" sample application I create a new JSP project with the template JSP Examples under Web but when i run it i just see 6 exampls and can not find the JSP 1.2 section. So i can not proceed with this lab. I am using Netbeans 6.7 with Tomcat Apache 2.2 on Windows XP service pack 3 Any help will be appreciated -- Saludos Alfredo Torres Hab.+58 212 9446304 Cel. +58 416 6118599 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en -~--~~~~--~~--~--~---
[java ee programming] Lab 4003 - homework - just one question
Hi Colleagues, I have made homework and it works good. According to homework requirements index.jsp forwards request to middle.jsp as follow: Just for test I have used for a moment For me more natural is to use this construction because I understand whole process as follow: Index.jsp forwards myparameter to response.jsp and finally middle.jsp using <%...@include file="response.jsp" %> includes response.jsp and displays all data of respomnse.jsp. Should I use above construction in future or maybe the construction of homework is more proper. Please advice. Best regards, Rafał Laczek Reżyser MUMII powraca z nowym widowiskowym G.I. Joe: CZAS KOBRY -> zobacz zwiastun filmu http://klik.wp.pl/?adr=http%3A%2F%2Fcorto.www.wp.pl%2Fas%2Fczaskobry.html&sid=823 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en -~--~~~~--~~--~--~---
[java ee programming] LAB 4003 add parameter question
Hi everyone, The homework tells us to add parameter to the request object in index.jsp before forwarding to middle.jsp. I added the parameter using the request.setAttribute() function and got the desired result. Is this okay? Or do I have to use jsp:param to add the parameter? But then jsp:param can be used only while forwarding and not before forwarding which the homework asks. Any suggestions would be appreciated. Thanks, Priya --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en -~--~~~~--~~--~--~---