tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "CPC Livelink Admin" <cpclv...@fitzpatrick.cc>
Subject RE: getParameter() help
Date Tue, 16 Jan 2001 23:07:30 GMT

I modded your code and made it a JSP so it was easy for me.
The following URLs work as expected.  You will need to change /livelink/ms
to whatever webapp you use, I just put it in there cuz it was easy

http://localhost:8080/livelink/ms/foo.jsp
http://localhost:8080/livelink/ms/foo.jsp?cmd=load
http://localhost:8080/livelink/ms/foo.jsp?cmd=load&pg=foo

JSP Below
---------------------------------------------

<HTML>
	<HEAD>
	</HEAD?
	<BODY>
<%
         String cmd = request.getParameter("cmd");

         if (cmd == null || cmd.equals(""))
         {
					%>
					<H1>Nothing in cmd</H1>
					<%

         }
         else if (cmd.equals("load"))
         {
                 String pgName = request.getParameter("pg");

                 if (pgName == null || pgName.equals(""))
                 {
									%>
                  <h1>page is missing or empty!!!</h1>
									<%
                 }
                 else
                 {
									%>
									<h1>Outputing page: <%= pgName %></H1>
									<%
                 }
         }
         else if (cmd.equals("search"))
         {
         }
%>

</BODY>
</HTML>


Mime
View raw message