Win a flower (🌹) or copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java (📚) this week in the Agile and Other Processes forum!

Waliullah Memon

+ Follow
since Sep 21, 2000
Apples and Likes
Apples
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Waliullah Memon

Hi,
I am trying to install Tomcat 3.1 on windows NT as follows .I made a folder Tomcat and unzipped the Tomcat inside it.
In the System--->Environment I set variables as follows

TOMCAT_HOME=d:\tomcat
JAVA_HOME =d:\jdk1.3
PATH
;d:\Tomcat\jakarta-tomcat\bin
CLASSPATH
;d:\jdk1.3\lib\tools.jar
Now when I Click on the startup.bat or go to dos and type startup.bat , a dos window just appers for a while and then disapperas...Am I missing anything...
Your Help will be greatly appreciated
Thanks in advance
Wali
[This message has been edited by Waliullah Memon (edited November 04, 2000).]
19 years ago
Hi,
I am a SCJP ,also intrested to participate in this project
walimemon@hotmail.com
Wali
19 years ago
Hi Maha , server side Form Validation has been explianed in a very nice way in "Web development with JSP".An example from this book is here which validates for email, ssn and Last, First name.
regards
Wali

package com.taglib.wdjsp.commontasks;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
public class FormHandlerServlet extends HttpServlet {

public void service(HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException {
Vector errors = new Vector();
String name = req.getParameter("name");
String ssn = req.getParameter("ssn");
String email = req.getParameter("email");
if (! isValidName(name))
errors.add("Please specify the name as Last, First");
if (! isValidEmail(email))
errors.add("Email address must contain an @ symbol");
if (! isValidSSN(ssn))
errors.add("Please specify a valid SSN number, no dashes");

String next;
if (errors.size() == 0) {
// data is OK, do whatever
// dispatch to wherever
next = "thanks.jsp";
}
else {
// data has errors, try again
String[] errorArray = (String[])errors.toArray(new String[0]);
req.setAttribute("errors", errorArray);
next = "form.jsp";
}
String base = "/commontasks/";
RequestDispatcher rd;
rd = getServletContext().getRequestDispatcher(base + next);
rd.forward(req, res);
}
private boolean isValidSSN(String ssn) {
// check for 9 characters, no dashes
return (ssn.length() == 9 && ssn.indexOf("-") == -1);
}
private boolean isValidEmail(String email) {
// check an "@" somewhere after the 1st character
return (email.indexOf("@") > 0);
}
private boolean isValidName(String name) {
// should be Last, First - check for the comma
return (name.indexOf(",") != -1);
}
}
//now the jsp part
<jsp:useBean id="form" class="com.taglib.wdjsp.commontasks.FormBean">
<jsp:setProperty name="form" property="*"/>
</jsp:useBean>
<html>
<body bgcolor="white">
<%
String[] errors = (String[])request.getAttribute("errors");
if (errors != null && errors.length > 0) {
%>
<b>Please Correct the Following Errors</b>
<ul>
<% for (int i=0; i < errors.length; i++) { %>
<li> <%= errors[i] %>
<% } %>
</ul>
<% } %>
<form action="<%= request.getContextPath() %>/servlet/FormHandlerServlet" method="post">
<input type="text" name="name"
value="<jsp:getProperty name="form" property="name"/>">
<b>Name</b> (Last, First)<br>
<input type="text" name="email"
value="<jsp:getProperty name="form" property="email"/>">
<b>E-Mail</b> (user@host)<br>
<input type="text" name="ssn"
value="<jsp:getProperty name="form" property="ssn"/>">
<b>SSN</b> (123456789)<br>
<p>
<input type="submit" value="Submit Form">
</form>
</body>
</html>
//and the bean
package com.taglib.wdjsp.commontasks;
public class FormBean {

private String name;
private String email;
private String ssn;

public FormBean() {
name = "";
email = "";
ssn = "";
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setEmail(String email) {
this.email = email;
}
public String getEmail() {
return email;
}
public void setSsn(String ssn) {
this.ssn = ssn;
}
public String getSsn() {
return ssn;
}
}
19 years ago
Hi,
Does it matter if I have Windows NT installed under FAT or NTFS for the installation of Weblogic???
Thanks in advance
Wali
19 years ago
Thanks a Lot George I found that comaprison very usefull.Also I read about naming policy thats why now I am using mu full name.
Wali
19 years ago
Read the Book "web development with java Server pages",there is a very good project in this book
or go here www.xmlmag.com
here you can find an online reservation system with xml and Jsp
Also there is another book going to be published in a week which will include a full Project building an auction house name of the book is "Java server pages from Scratch"
regards
Wali
[This message has been edited by Waliullah Memon (edited October 17, 2000).]
19 years ago
Hi you can also use orion server, it supports ejb www.orionserver.com
Wali
Hi,
I want to be a moderator at the programmer Certification forum.what are the requirments.
wali
19 years ago