ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

simple servlet development on iseries

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Re: simple servlet development on iseries

    Ok, when you test the project on the local websphere, it configures the ear project, it is displayed separately. So i exported the ear project, and pasted to the folder you told me, and went to the httpadmin website. But i can't seem to find the option where to deploy the app (like i remember from my tomcat days)

    Comment


    • #17
      Re: simple servlet development on iseries

      Under 'WAS Wizards' on the left hand menus you will see an option called Install New Application

      You want to then select the radio button 'Application is contained in an EAR file', and then you want to Browse for the file. The Browse button should pull you up inside of the Installable Apps folder. Just select your EAR from the list and click OK. Then click Next.

      On the next screen you want to make sure that you click the check box to Pre-compile JSPs. Click Next and just click Next through until you can click Finish. The Admin console will populate the fields for you with Application Names and local hosts. Then your Application will show to be Installing in the list of Applications when you click on Manage Installed Applications from the Applications menu on the left side of the Admin console.

      You can hit the Refresh button to see if it has completed the install. If it has then it will be Stopped and have a red dot in the Status column. Click the radio button next to your app and then click Start. This will start up your app.

      I hope this gets you up and running.
      Your future President
      Bryce

      ---------------------------------------------
      http://www.bravobryce.com

      Comment


      • #18
        Re: simple servlet development on iseries

        Browsing lots of pages at IBM i found out that the HTTPADMIN app you supplied isn't the one to install apps. I needed to use webphere's admin console, which is available at http://server_name:9060/admin/

        Ok this is a very stupid question, i installed the app, but i don't see anywhere the actual freaking URL of the installed app! How do i see it working?

        Comment


        • #19
          Re: simple servlet development on iseries

          Yes, you need to run WebSphere's Admin Console. That is just the URL to ours. I didn't set it up and assumed that it was the same across the board. Sorry for the confusion.


          If you are on an internal network and have DNS set up then this is how it would be...



          so if your Dynamic Web Project was MyServlet and your jsp was Servlet.jsp and you were working for yahoo on their server it would look something like this...



          when you execute that URL your jsp will fire off and do whatever it is supposed to do. If it is supposed to put some data somewhere just check to see that the data got there. One easy way to check it if ran is to insert this into the jsp...

          out.print("Servlet Fired");

          you don't even need any html. If it runs then that message will show up in your browser. When you are certain the servlet is working you can take it out.



          ***I just realized that what I said above would be from an HTTP Admin, which is part of our Websphere Admin Console. I'm guessing your URL would actually be this...

          http://serverName:Port#/ProjectName/MyJSP.jsp
          Your future President
          Bryce

          ---------------------------------------------
          http://www.bravobryce.com

          Comment


          • #20
            Re: simple servlet development on iseries

            I am not using jsp, i hate them

            My project is named pruebaservlet, but http://iseries/pruebaservlet doesn't work, we have other tests done with webfacing, i will ask the boss on monday the url, it should be the same, i am sure i am missing the port number...

            You should try freemarker I will post back on monday with my findings. Thanks

            Comment


            • #21
              Re: simple servlet development on iseries

              What is freemarker?? I'll be waiting to see how you did this.
              Your future President
              Bryce

              ---------------------------------------------
              http://www.bravobryce.com

              Comment


              • #22
                Re: simple servlet development on iseries

                Freemarker is a library that simplifies templating. Instead of doing out.println in the servlets, i do a requestdispatcher to a template file .ftl, which is just html with very little tags for presentation purposes.

                Much more simple and cleaner than jsp. I could make the hello world servlet work, the port was :9080, and i am currently in contact with the freemarker developers to help me integrate freemarker with websphere, since i am getting a weird servlet not found error even when it is on the classpath and showing up in the IDE just fine.

                For more info, check out http://freemarker.sf.net

                Comment


                • #23
                  Re: simple servlet development on iseries

                  I'll have to check into it later today. Thanks fjleon. Good luck getting the rest working
                  Your future President
                  Bryce

                  ---------------------------------------------
                  http://www.bravobryce.com

                  Comment


                  • #24
                    Re: simple servlet development on iseries

                    Originally posted by fjleon View Post
                    Instead of doing out.println in the servlets


                    If you're using JSP then you shouldn't be doing out.println in the servlets and if you're using JSP 2.0 (I think this is about 5 years old now so you it should be established) you shouldn't be embedding Java code.

                    You should be using the expression language...


                    If you can't find the tag you need there then there is also the jstl.jar available with some standard tags. If you still can't find the tag you need then you can create custom tags.

                    There are a number of ways to string a cat in Java but it is unfair to compare some new framework to JSP techniques that date back to the original dot com boom. These technology's can also be supplemented with an MVC framework such as struts or spring.

                    If you're serious about Java EE web development then I've found the best book is the Head first one. It's written by the authors of the Java certification exams and it's actually quite entertaining to read! There is also a forum set up by these same people which is an excellent resource for any Java developer. If you can't get a Java question answered here then http://www.javaranch.com/ is the place to look.
                    Ben

                    Comment


                    • #25
                      Re: simple servlet development on iseries

                      Here are the reasons i like freemarker over jsp 2.0 for anyone that is interested.



                      Basically, it is easier, simpler and quicker. For my uses it does what i need.

                      Comment


                      • #26
                        Re: simple servlet development on iseries

                        Hey guys, i finished my application, but when i run it on the iseries i get this error:

                        Error 500: no cmm in java.library.path

                        I have searched a little, and i have seen a suggestion to turn on a system property called java.awt.headless=true in the file:

                        /QIBM/UserData/Java400/SystemDefault.properties file

                        How can i modify this file in the iseries?

                        I tried qsh but even if i type "cd" i get the error:

                        cd /QIBM

                        cd: 001-0085 too many arguments in the call.

                        i don't know what is happening.

                        Comment


                        • #27
                          Re: simple servlet development on iseries

                          Well, QSH sucks. But anyway, the problem i have is that JPEGImageEncoder / JPEGCodec are Sun's propietary classes and IBM doesn't have them.

                          Anyone know of a replacement? I just want to save a BufferedImage as a JPG.

                          OutputStream os = new FileOutputStream("file.jpg");
                          JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os);
                          encoder.encode(bi); //bi is the BufferedImage i want to save
                          os.flush();
                          os.close();

                          Comment


                          • #28
                            Re: simple servlet development on iseries

                            You say that the JPEGImageEncoder is Sun't proprietary classes, but can't you install the package onto the iSeries? Heck, all java classes that come with the JDK are Sun's classes.

                            Just a little confused I guess...

                            PS. I started switching from writing a code mashed JSP app to breaking up my app into MVC. I'm to the point where my servlet pushes info to the bean (i think) but I can't seem to get it out with the EL. So that's what I'm working on today while about 95% of the people here are out shopping.
                            Your future President
                            Bryce

                            ---------------------------------------------
                            http://www.bravobryce.com

                            Comment


                            • #29
                              Re: simple servlet development on iseries

                              Check out my GPL project, it's called mortiforo on sourceforge. Browse the cvs to see very simple examples on how to do this.

                              By using freemarker i do all the html code in .ftl templates, which is html plus simple syntax for if, cycles and such.

                              By using sqlmaps, i have all my sql queries in a xml file, outside of the code and outside of the presentation layer. This benefit makes your code portable, and mortiforo shows it, since you just have to write the xml file with your queries to make it work on any database.

                              Sqlmaps lets you map java beans to objects, very handy, and a lot saner than hibernate.

                              About the jpeg issue, remember that ibm uses its own JVM and therefore propietary classes (the one starting with com.something instead of java.something) aren't included.

                              I have just switched those classes for java's standard ImageIO api.

                              Comment


                              • #30
                                Re: simple servlet development on iseries

                                Thanks for the example code to look at, but I still can't see where I'm going wrong. I've looked at multiple examples, including an example that I have in my websphere that I downloaded from javaranch. Their example works great, but when I try to model their code it just doesn't work.

                                Maybe you can see something....

                                here is my code, its really quite simple...

                                This is my selection page. There is a lot of javascript validation of search combinatins that we allow at the top. Don't worry about those, the code of concern would be in the form...


                                Code:
                                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
                                <&#37;@include file="globalVariables.jsp" %>
                                <%@include file="date.js" %>
                                
                                <HTML>
                                <HEAD>
                                <script>
                                function ValidateForm(form)
                                {
                                	if (CustNotNull(form.number.value))
                                	{
                                		if(!IsNumeric(form.number.value))
                                		{
                                			alert('Please enter only numbers in the Customer Number field')
                                			form.number.focus();
                                			return false;
                                		}
                                	}
                                	
                                	if (OrderNotNull(form.ord.value))
                                	{
                                		if(!IsNumeric(form.ord.value))
                                		{
                                			alert('Customer orders must contain only numbers.')
                                			form.ord.focus();
                                			return false;
                                		}
                                	}
                                
                                	if(PONotNull(form.po.value) && CustNotNull(form.number.value) && JobNotNull(form.job.value) &&  CustNameNotNull(form.custname.value) && OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(PONotNull(form.po.value) && CustNotNull(form.number.value) && JobNotNull(form.job.value) && CustNameNotNull(form.custname.value) && !OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(PONotNull(form.po.value) && CustNotNull(form.number.value) && JobNotNull(form.job.value) && !CustNameNotNull(form.custname.value) && OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}	
                                	else if(PONotNull(form.po.value) && CustNotNull(form.number.value) && !JobNotNull(form.job.value) && CustNameNotNull(form.custname.value) && OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(PONotNull(form.po.value) && !CustNotNull(form.number.value) && JobNotNull(form.job.value) && CustNameNotNull(form.custname.value) && OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(!PONotNull(form.po.value) && CustNotNull(form.number.value) && JobNotNull(form.job.value) && CustNameNotNull(form.custname.value) && OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(PONotNull(form.po.value) && CustNotNull(form.number.value) && !JobNotNull(form.job.value) && CustNameNotNull(form.custname.value) && !OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}	
                                	else if(PONotNull(form.po.value) && !CustNotNull(form.number.value) && JobNotNull(form.job.value) && CustNameNotNull(form.custname.value) && !OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(!PONotNull(form.po.value) && CustNotNull(form.number.value) && JobNotNull(form.job.value) && CustNameNotNull(form.custname.value) && !OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(PONotNull(form.po.value) && CustNotNull(form.number.value) && !JobNotNull(form.job.value) && !CustNameNotNull(form.custname.value) && OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(PONotNull(form.po.value) && !CustNotNull(form.number.value) && JobNotNull(form.job.value) && !CustNameNotNull(form.custname.value) && OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(!PONotNull(form.po.value) && CustNotNull(form.number.value) && JobNotNull(form.job.value) && !CustNameNotNull(form.custname.value) && OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(PONotNull(form.po.value) && !CustNotNull(form.number.value) && !JobNotNull(form.job.value) && CustNameNotNull(form.custname.value) && OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(!PONotNull(form.po.value) && CustNotNull(form.number.value) && !JobNotNull(form.job.value) && CustNameNotNull(form.custname.value) && OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(!PONotNull(form.po.value) && !CustNotNull(form.number.value) && JobNotNull(form.job.value) && CustNameNotNull(form.custname.value) && OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(PONotNull(form.po.value) && !CustNotNull(form.number.value) && !JobNotNull(form.job.value) && CustNameNotNull(form.custname.value) && !OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(PONotNull(form.po.value) && !CustNotNull(form.number.value) && !JobNotNull(form.job.value) && !CustNameNotNull(form.custname.value) && OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(!PONotNull(form.po.value) && CustNotNull(form.number.value) && !JobNotNull(form.job.value) && CustNameNotNull(form.custname.value) && !OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(!PONotNull(form.po.value) && CustNotNull(form.number.value) && !JobNotNull(form.job.value) && !CustNameNotNull(form.custname.value) && OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(!PONotNull(form.po.value) && !CustNotNull(form.number.value) && JobNotNull(form.job.value) && CustNameNotNull(form.custname.value) && !OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(!PONotNull(form.po.value) && !CustNotNull(form.number.value) && JobNotNull(form.job.value) && !CustNameNotNull(form.custname.value) && OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(!PONotNull(form.po.value) && !CustNotNull(form.number.value) && !JobNotNull(form.job.value) && CustNameNotNull(form.custname.value) && OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(!PONotNull(form.po.value) && CustNotNull(form.number.value) && !JobNotNull(form.job.value) && !CustNameNotNull(form.custname.value) && !OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	else if(!PONotNull(form.po.value) && !CustNotNull(form.number.value) && !JobNotNull(form.job.value) && !CustNameNotNull(form.custname.value) && !OrderNotNull(form.ord.value))
                                	{
                                		alert('Select by PO, Cust Number, and Job Name or by Order Number or Cust Name only.')
                                		form.po.focus();
                                		return false;
                                	}
                                	
                                	return true;
                                }
                                
                                function IsNumeric(sText)
                                {
                                	var ValidChars = "0123456789";
                                	var IsNumber=true;
                                	var Char;
                                 
                                 	for (i = 0; i < sText.length && IsNumber == true; i++) 
                                 	{ 
                                  		Char = sText.charAt(i); 
                                    	if (ValidChars.indexOf(Char) == -1) 
                                      	{
                                      		IsNumber = false;
                                      	}
                                   	}
                                   	return IsNumber;	
                                }
                                
                                function CustNotNull(chkval1)
                                {
                                	var NotNull1 = true;
                                	
                                	if (chkval1.length == 0)
                                	{
                                		NotNull1 = false;
                                	}
                                	else
                                	{
                                		NotNull1 = true;
                                	}
                                	return NotNull1;
                                }
                                
                                function OrderNotNull(chkval3)
                                {
                                	var NotNull3 = true;
                                	
                                	if (chkval3.length == 0)
                                	{
                                		NotNull3 = false;
                                	}
                                	else
                                	{
                                		NotNull3 = true;
                                	}
                                	return NotNull3;
                                }
                                
                                function PONotNull(chkval2)
                                {
                                	var NotNull2 = true;
                                	
                                	if (chkval2.length == 0)
                                	{
                                		NotNull2 = false;
                                	}
                                	else
                                	{
                                		NotNull2 = true;
                                	}
                                	return NotNull2;
                                }
                                
                                function JobNotNull(chkval4)
                                {
                                	var NotNull4 = true;
                                	
                                	if(chkval4.length == 0)
                                	{
                                		NotNull4 = false;
                                	}
                                	else
                                	{
                                		NotNull4 = true;
                                	}
                                	return NotNull4;
                                }
                                
                                function CustNameNotNull(chkval5)
                                {
                                	var NotNull5 = true;
                                	
                                	if(chkval5.length == 0)
                                	{
                                		NotNull5 = false;
                                	}
                                	else
                                	{
                                		NotNull5 = true;
                                	}
                                	return NotNull5;
                                }
                                
                                </script>
                                
                                <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
                                	pageEncoding="ISO-8859-1"%>
                                <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
                                <META name="GENERATOR" content="IBM Software Development Platform">
                                <META http-equiv="Content-Style-Type" content="text/css">
                                <LINK rel="stylesheet" href="csgroup.css" type="text/css">
                                <SCRIPT language="javascript" src="date.js"></SCRIPT>
                                <TITLE>Selection.jsp</TITLE>
                                </HEAD>
                                <BODY>
                                <br>
                                <br>
                                <form name=select  method=post  action=MVC  onsubmit="javascript:return ValidateForm(this)">
                                
                                <table width="800" border="0" cellspacing="0" cellpadding="2">
                                	<tr>
                                		<td width='115' valign="top"><IMG border="0" src="theme/smallblue3.jpg" width="173" height="24"></td>
                                		<td align='right'><SCRIPT type="text/javascript">getDate();</SCRIPT></td>
                                	</tr>
                                	<TR>
                                		<TD align="center" colspan="2"><H1>C/S Order Recap</H1></TD>
                                	</TR>
                                	<tr><td align=center colspan="2">
                                		<TABLE width="400" cellspacing="0" cellpadding="5">
                                		  	<TR valign="middle">
                                	   			<TH  align='left' style='font-size: 110%'>Customer PO</TH>
                                	   			<TH align='left'><INPUT type="text" name="po" maxlength="15" tabindex="1" size="15" value="${myBeanClass.po}"></TH>
                                		  	</TR>
                                	  		<TR valign="middle">
                                	   			<TH align='left' style='font-size: 110%'>Customer Number</TH>
                                		   		<TH align='left'><INPUT type="text" name="number" maxlength="6" tabindex="2" size="6"></TH>
                                	  		</TR>
                                	  		<TR valign="middle">
                                	   			<TH  align='left' style='font-size: 110%'>Job Name</TH>
                                	   			<TH align='left'><INPUT type="text" name="job" maxlength="50" tabindex="3" size="50"></TH>
                                		  	</TR>
                                		  	<TR valign="middle">
                                		  		<TH align='center' style='font-size: 75%' colspan=2>OR</TH>
                                		  	</TR>
                                		  	<TR valign="middle">
                                	   			<TH  align='left' style='font-size: 110%'>Customer Name</TH>
                                	   			<TH align='left'><INPUT type="text" name="custname" maxlength="30" tabindex="4" size="30"></TH>
                                		  	</TR>
                                		  	<TR valign="middle">
                                		  		<TH align='center' style='font-size: 75%' colspan=2>OR</TH>
                                		  	</TR>
                                		  	<TR valign="middle">
                                	   			<TH  align='left' style='font-size: 110%'>Order Number</TH>
                                	   			<TH align='left'><INPUT type="text" name="ord" maxlength="6" tabindex="5" size="6"></TH>
                                		  	</TR>
                                
                                		  	<TR valign="middle">
                                				<% 	String pagecode = "";
                                					String Error = "";
                                					Error = (String)session.getAttribute("Err");
                                					pagecode = "<td id='err' align='left' colspan='2'></td>\n";
                                					if(Error == "" || Error == null)
                                					{
                                						pagecode = "<td id='err' align='left' colspan='2'></td>\n";
                                					}
                                					else if(Error != "")
                                					{
                                						pagecode = "<td id='err' align='left' colspan='2'>" + Error + "</td>\n";
                                					}
                                					out.print(pagecode);
                                	            %>
                                
                                		  	</TR>
                                		</TABLE>
                                	<BR>
                                		<INPUT type="submit" tabindex="6" value="Submit">
                                		
                                	</td></tr>
                                </table>
                                <%session.removeAttribute("myPackage"); %>
                                </form>
                                </BODY>
                                </HTML>

                                Then this is the bean that it is supposed to write to, which it does, i was able to test this.
                                Code:
                                /*
                                 * Created on Nov 19, 2007
                                 *
                                 * TODO To change the template for this generated file go to
                                 * Window - Preferences - Java - Code Style - Code Templates
                                 */
                                package myPackage;
                                
                                /**
                                 * @author bmartin
                                 *
                                 * TODO To change the template for this generated type comment go to
                                 * Window - Preferences - Java - Code Style - Code Templates
                                 */
                                public class MyBeanClass 
                                {
                                	private String po;
                                	private String number;
                                	private String job;
                                	private String custName;
                                	private String ord;
                                	private String sql;
                                
                                	public void setPo(String value)
                                	{
                                		this.po = value;
                                	}
                                
                                	public void setNumber(String value2)
                                	{
                                		this.number = value2;
                                	}
                                	
                                	public void setJob(String value3)
                                	{
                                		this.job = value3;
                                	}
                                	
                                	public void setCustname(String value4)
                                	{
                                		this.custName = value4;
                                	}
                                	
                                	public void setOrd(String value5)
                                	{
                                		this.ord = value5;
                                	}
                                	
                                	public void setSql(String value6)
                                	{
                                		this.sql = value6;
                                	}
                                	public String getPO(){ return this.po;}
                                	public String getNumber(){return number;}
                                	public String getJob(){return job;}
                                	public String getCustName(){return custName;}
                                	public String getOrd(){return ord;}
                                	public String getSql(){return sql;}
                                }
                                Then the form does an action over to my servlet which I have mapped in my web.xml. Here is the servlet...

                                Code:
                                package myPackage;
                                
                                import java.io.*;
                                import javax.servlet.*;
                                import javax.servlet.http.*;
                                
                                /*
                                 * Created on Nov 20, 2007
                                 *
                                 * TODO To change the template for this generated file go to
                                 * Window - Preferences - Java - Code Style - Code Templates
                                 */
                                
                                /**
                                 * @author bmartin
                                 *
                                 * TODO To change the template for this generated type comment go to
                                 * Window - Preferences - Java - Code Style - Code Templates
                                 */
                                public class FormManager extends HttpServlet
                                {	
                                	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
                                	{
                                		response.setContentType("text/html");
                                		response.setHeader("pragma", "no-cashe");
                                		PrintWriter out = response.getWriter();
                                		
                                		//Put the code for processing a new page here.
                                	}
                                	
                                	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
                                	{
                                		MyBeanClass myBeanClass = new MyBeanClass();
                                		
                                		myBeanClass.setPo(request.getParameter("po"));
                                		myBeanClass.setNumber(request.getParameter("number"));
                                		myBeanClass.setJob(request.getParameter("job"));
                                		myBeanClass.setCustname(request.getParameter("custname"));
                                		myBeanClass.setOrd(request.getParameter("ord"));
                                		
                                		request.setAttribute("mybeanclass", myBeanClass);
                                		
                                		getServletContext().getRequestDispatcher("/results.jsp").forward(request,response);
                                	}
                                }


                                And finally the servlet forwards over to my results.jsp page which couldn't be any simpler...


                                Code:
                                <HTML>
                                
                                <HEAD>
                                <TITLE>Search Results</TITLE>
                                </HEAD>
                                <BODY>
                                <p>${myBeanClass.po}</p>
                                <p>${myBeanClass.number}</p>
                                <p>${myBeanClass.job}</p>
                                <p>${myBeanClass.custname}</p>
                                <p>${myBeanClass.ord}</p>
                                
                                </BODY>
                                </HTML>
                                Everything redirects just fine and I get to my results.jsp except that the page is blank. I can't get it to print any values. Not even "NULL". I'm about lost at this point...
                                Last edited by bryce4president; November 23, 2007, 08:14 AM.
                                Your future President
                                Bryce

                                ---------------------------------------------
                                http://www.bravobryce.com

                                Comment

                                Working...
                                X