Jaggi Kunal

Ranch Hand
+ Follow
since Jan 21, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
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 Jaggi Kunal

I want to make use of the CLIENT-CERT Authentication.
I have followed all the desired steps and successfully tested JSP’s.
But I am still wondering where exactly is the .keystore located.

<JAVA_HOME>\bin\keytool -genkey -alias tomcat -keyalg RSA
I was expecting that the .keystore file will be located in the bin directory. But, instead it is located in E:\Documents and Settings\Administrator. That is quite surprising? Can anybody explain why the file is stored there?
I am using Tomcat4.1.12 on Windows 2000 Professional.
Regards,
Kunal Jaggi
SCJP2
20 years ago
JSP
I am using MS SQL Server 2000 on Windows 2000 Pro.
In the JDBC API 2.0 (javax.sql) How can be obtain a scrollable ResultSet corresponding to a PreparedStatement object? I
Following is a code snippet which obtains a scrollable ResultSet from a Statement object:
Statement myStatement =
conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
I have JDK1.4. But when I try to print the API using javap javax.sql.Connection I don’t get the output. What do we need to install for JDBC2.0?
Regards,
Kunal Jaggi
SCJP2
I am new to JSP. I have recently purchases the Professional JSP 2nd Edition book, Wrox Press. I am finding the book good, this book is based on JSP1.2. I have heard thet Servlet 2.4 and JSP2.0 have been released. What new in JSP 2.0? Is it worth spending more time on the book or I should try some other JSP book based on JSP2.0?
Regards,
Kunal Jaggi
SCJP2
20 years ago
JSP
I want to write Secure JSP’s. For this I want to make use of HTTPS CLIENT Authentication mechanism. I have followed the following steps :-
Step 1 : Installing SSL Libraries.
For this we need JSSE. Since I am using JDL1.4 to it is already there.
Step 2 : Enabling SSL in <CATALINA_HOME>\conf\server.xml (I am using Tomcat 4.1.12)
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="8083" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0" scheme="https" secure="true">

<Factory className="org.apache.catalina.net.SSLServerSocketFactory" clientAuth="false" protocol="TLS" />
</Connector>
This is causing the Server to shutdown whenever started (startup.bat).
Step 3 : Generating public and private keys
How do I generate public and private keys for alias “tomcat”? Is the following command correct.
<JAVA_HOME>\keytool –genkey –alias tomcat –keyalg RSA
OR it should be :
<CATALINA_HOME>\keytool –genkey –alias tomcat –keyalg RSA
Step 4 Changing web.xml
Can anybody help me to tackle the problems encountered in step 2 and 3.
Regards,
Kunal Jaggi
SCJP2
20 years ago
JSP
Hi Ashish,
What you want is called Role based authentication. In J2EE there are 4 kinds of role based authentications namely :
1.HTTP Basic Authentication
2.HTTP Form based Authentication
3.HTTP Digest Authentication
4.HTTPS CLIENT CERT Authentication
The other kind of security we can provide is called Programmatic Security. Internally the Servlet Container implements Form based Authentication as Programmatic. In this approach Tomcat tries to locate The User Principal in your session, if the Principal is not found or if it is not correct then the user the redirected to the login page (here you can see the session id in the address bar).
Following is a code Snippet that shows Basic Authentication at work :

Step 1 Changes to the Deployment Descriptor
<servlet>
<servlet-name>
secret
</servlet-name>
<servlet-class>
ProtectedServer
</servlet-class>
</servlet>
<security-constraint>
<web-resource-collection>
<web-resource-name>
SecretProtection
</web-resource-name>
<url-pattern>
/servlet/ProtectedServer
</url-pattern>
<url-pattern>
/servlet/secret
</url-pattern>
<http-method>
GET
</http-method>
<http-method>
POST
</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>
administrator
</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>
BASIC
</auth-method>
<realm-name>
Default <!-- optional, only useful for BASIC -->
</realm-name>
</login-config>
<security-role>
<role-name>
manager
</role-name>
</security-role>
Step 2
Changes to CATALINA_HOME\conf\tomcat-users.xml file
<user name="kunaljaggi" password="sunone" roles="administrator" />
Hope this helps
Regards,
Kunal Jaggi
SCJP2
[ April 30, 2003: Message edited by: Jaggi Kunal ]
20 years ago
I am using Tomcat 4.1.12.
I want to use HTTPS Client-CERT authentication , I have made app. changes to the web.xml file.
How do I generate public and private keys for alias “tomcat”. Is the following command correct.
<JAVA_HOME>\keytool –genkey –alias tomcat –keyalg RSA
OR it should be :
<CATALINA_HOME>\keytool –genkey –alias tomcat –keyalg RSA

Regards,
Kunal Jaggi
SCJP2
20 years ago
Hi ,
Can anybody let me know how to set up SSL (URL’s starting with https) connection with Tomcat in a step-by-step tutorial. Also, can we achieve Programmatic Security through SSL?
Where do we generate public and private keys for alias “tomcat”. Is the following command correct.
<JAVA_HOME>\keytool –genkey –alias tomcat –keyalg RSA
OR it should be :
<CATALINA_HOME>\keytool –genkey –alias tomcat –keyalg RSA

Regards,
Kunal Jaggi
SCJP2
20 years ago
What is the expiry period of SCWCD exam? I passed SCJP2 in Dec. last year, that time I was under the impression that Sun Certifications are valid for lifetime, but this is not true, within a month I received the Certificate. It was clearly mentioned on the Cert. And that card that the Cert will expire on Dec. 2004.
Regards,
Kunal Jaggi
SCJP
Hi
There is no point to cram!!
I first want to make my knowledge of JSP strong to a decent extent and then think of taking the certification exam. Gone those days when getting a Vendor Certification can fetch you a job. Certification (SCWCD) may help to get an interview call. But, what matters most is the hands-on knowledge.
Anybody interested in forming a Study Group in/around Delhi/Gurgaon may please contact me at kunaljaggi@yahoo.com.
Regards,
Kunal Jaggi
SCJP (89%)
I am trying to create a JSP page using XML.
Here is the code snipper :-
<%-- XMLJsp.jsp --%>
<HTML>
<HEAD><HEAD>
<BODY>
<jsp:expression>request.getParameter("name")</jsp:expression>
</BODY>
</HTML>
Now, when I try to access the JSp page using the URL http://localhost:8080/XMLJsp.jsp?name=Kunal
I get a compiler error jsp.error.badaction.
Is there something wrong with the code. I am using Tomcat 4.1.12
Regards,
Kunal Jaggi
SCJP2
20 years ago
JSP
I want to retrieve Parameters in a JSP page which are set by another JSP page.
Following are the two code snippets :
<%-- Param1.jsp --%>
<HTML>
<HEAD><HEAD>
<BODY>
<jsp arams>
<jsp aram name="name" value="Yash" />
<jsp aram name="age" value="23" />
<jsp aram name="eyes" value="black" />
</jsp arams>
<A HREF="/Param2.jsp">Click Here</A>
</BODY>
</HTML>
<%-- Param2.jsp --%>
<HTML>
<HEAD><HEAD>
<BODY>
<%
out.println("<b>"+request.getParameter("name")+"</b>");
out.println("<b>"+request.getParameter("age")+"</b>");
out.println("<b>"+request.getParameter("eyes")+"</b>");
%>
</BODY>
</HTML>
I am getting a compilation error when I access Param1.jsp using http://localhost:8080/Para1.jsp. I am using Tomcat 4.1.12.

Regards,
Kunal Jaggi
SCJP
I want to retrieve Parameters in a JSP page which are set by another JSP page.
Following are the two code snippets :
<%-- Param1.jsp --%>
<HTML>
<HEAD><HEAD>
<BODY>
<jsp arams>
<jsp aram name="name" value="Yash" />
<jsp aram name="age" value="23" />
<jsp aram name="eyes" value="black" />
</jsp arams>
<A HREF="/Param2.jsp">Click Here</A>
</BODY>
</HTML>
<%-- Param2.jsp --%>
<HTML>
<HEAD><HEAD>
<BODY>
<%
out.println("<b>"+request.getParameter("name")+"</b>");
out.println("<b>"+request.getParameter("age")+"</b>");
out.println("<b>"+request.getParameter("eyes")+"</b>");
%>
</BODY>
</HTML>
I am getting a compilation error when I access Param1.jsp using http://localhost:8080/Para1.jsp. I am using Tomcat 4.1.12.

Regards,
Kunal Jaggi
SCJP
[ April 01, 2003: Message edited by: Jaggi Kunal ]
20 years ago
JSP
Can anybody explain me a step-by-step procedure about how to establish a SSL connection?
Regards,
Kunal Jaggi
SCJP2
I have recently started writing Servlet code. I want to know, how to send data from a web page to a Servlet in an encrypted format?
Here is the web page
<form method='post' action='/servlet/UserLogin'>
<table>
<tr>
<td><b>ID</b></td>
<td><input type='text' name='id'></td>
</tr>
<tr>
<td><b>Password</b></td>
<td><input type='password' name='pass'></td>
</tr>
<tr>
<td><input type='submit' value='Submit'></td>
</tr>
</table>
</form>
In the servlet I am retriving the parameters using HttpservletRequest.getParameter(String) method.
In an ordinary case, the client establishes a socket connection with the web server and passes data as plain text but I want the same to be send in encrypted form.
I have no prior knowledge of Java Security API. And, I don’t want to establish a SSL connection.

Regards,
Kunal Jaggi
SCJP2