Rupali Desai

Ranch Hand
+ Follow
since May 29, 2001
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 Rupali Desai

I am encountering the following problem:



My original XML document has the following text



<NM>The Fast & The Furious: Tokyo</NM>

After I parse and rewrite the document as an XML file, during the parsing from XML to DOM to XML the above gets changed to

<NM>The Fast & The Furious: Tokyo</NM>

Is there a way to specify that you want number entity reference instead of the character entity reference.

Thanks
Rupali
Hello,

Can anyone recommend some good books on J2ME for a novice.

Thanks
Rupali
13 years ago
Jeanne,
I agree with you that modifying the ear would be a logical solution, but unfortunately we have no control over the assembly of this ear and they are against having to maintain to versions of the ear.

Thanks for your feedback

Rupali
13 years ago
Hello,

I have web application packaged as a ear which needs to access a set of utility classes which cannot for some reason be packaged as a utility jar in this ear.

What are the alternatives? Is it possible that these utility classes be packaged as another ear and have the classes in the first ear to refer to them.

The bottom line is I cannot modify the first ear, but it needs to refer to these utility classes.

Thanks
Rupali
13 years ago
Hello,

Is there a way to create custom templates for classes
methods in eclipse. If yes could someone please direct
me to some information on this topic.

Thanks
Rupali
Hello,
Well I got it to work with Tomcat 3.2.For some reason it never worked with tomcat 3.3.I even tried reinstalling toncat 3.3.
I am going to try an dtest with tomcat 4.1.
But anyone it works fine with tomcat 3.2.
Thanks for all the help.
Rupali Desai
17 years ago
JSP
I tried it out with packages but even that doesnt seem to work.Only when i set the scope to application is a new bean not created.
Rupali Desai
17 years ago
JSP
Thanks for the reply.I will try it out with packages.
Thanks
Rupali desai
17 years ago
JSP
No That didnt help. It basically creates a new bean when a page is accessed instead of maintaining the bean through out the session.
Thanks for the suggestion
Rupali
17 years ago
JSP
Hello,
Please could someone guide me as to what is wrong with the following code:

EmpBean.jsp
/*
* EmpBean.java
*
* Created on December 31, 2002, 10:23 AM
*/
import java.beans.*;
/**
*
* @author Administrator
*/
public class EmpBean extends Object implements java.io.Serializable
{

private String fname;
private String lname;
private String salary;
/** Creates new EmpBean */
public EmpBean()
{
System.out.println("Creating a new bean");
}

public String getFname()
{
return fname;
}

public void setFname(String value)
{
System.out.println("Storing FName"+value);
fname = value;
}

public String getLname()
{

return lname;
}

public void setLname(String value)
{
System.out.println("Storing LName"+value);
lname = value;
}

public void setSalary(String value)
{
System.out.println("Storing salary value"+value);
salary = value;
}

public String getSalary()
{
return salary;
}


}
--------------
EmpData.jsp
<%@page contentType="text/html"%>
<html>
<head><title>JSP Page</title></head>
<body>
<jsp:useBean id="empData" scope="session" class="EmpBean" />
<jsp:setProperty name="empData" property="*" />

<FORM METHOD="POST" ACTION="/genericacg/Display.jsp">
FirstName<input type="text" value="" name="fname"><br>
Last Name <input type="text" value="" name="lname"><br>
<INPUT TYPE="SUBMIT" VALUE="SENT" NAME="GO" >
</FORM>
</body>
</html>
---------------
Display.jsp
<%@page contentType="text/html"%>
<html>
<head><title>JSP Page</title></head>
<body>
<jsp:useBean id="empData" scope="session" class="EmpBean" />
<jsp:setProperty name="empData" property="*" />
<%= empData.getFname() %><br>
<%= empData.getLname() %><br>
<FORM METHOD="POST" ACTION="/genericacg/Salary.jsp">
Salary<input type="text" value="" name="salary"><br>
<INPUT TYPE="SUBMIT" VALUE="SENT" NAME="GO" >
</FORM>
</body>
</html>
-------------
Salary.jsp
<%@page contentType="text/html"%>
<html>
<head><title>JSP Page</title></head>
<body>
<jsp:useBean id="empData" scope="session" class="EmpBean" />
<jsp:setProperty name="empData" property="*" />
<%= empData.getFname() %><br>
<%= empData.getLname() %><br>
<%= empData.getSalary() %><br>
</body>
</html>
---------------
Now my starting point is EmpData.jsp
When I click on the "submit" button on this page i get Display.jsp which shows the Employee Fname and last name and collects info about the salary.
When I click on te "submit" on Display.jsp I get Salary.jsp.
Which shows the FName and LName as null but shows the Salary entered in Display.jsp.
My problem is even though I maintain the scope of the bean as "session" it does not persist across different jsp pages.Instead a new bean is created when I access a diff jsp page.
I want the bean data to persist during a session.Is my method of doing it incorrect?Could someone guide me towards the right way of doing this.
Thanks
Ruplai Desai
17 years ago
JSP
Hello,
I am new to jsp.So please guide me on this design problem.I have a form which has 5 parts to it.At each part accepts a set of inputs.At the end of each part the user clicks on a button to get data for the next part.
To understand the application I had intially designed the GUI using swing.Updating the data in next part based on the data entered in the first part was easy swing.
But i am having difficulties doing it using JSP and servlets.Is there any way ,when the user clicks a button on a jsp page.I can just add dynamically add new html to that page without having to write the whole page.OR JSP is not the right choice.
Thanks
Rupali
17 years ago
JSP
Hello,
I have a client inside a firewall,which posts a request to a https server outside the firewall.
I have everything functioning without the firewall.Now I have to figure out a way so that the client binds to a particular port on a particular network card.
I have used httpsURLconnection to connect to the https web server.But that solution wont work as I now have to be able to bind to particular local port.
So I am looking at Socket programming using SSL.Is this the right way to go.Could some direct to more material on this matter.
Thanks
Rupali
Hello,
I was experimenting with the following program
and I get the an SSLHandshakeException when I try to execute it.
/*
* @(#)SSLSocketClient.java 1.3 01/05/10
*
* Copyright 1995-2002 Sun Microsystems, Inc. All Rights Reserved.
*/

import java.net.*;
import java.io.*;
import javax.net.ssl.*;
/*
* This example demostrates how to use a SSLSocket as client to
* send a HTTP request and get response from an HTTPS server.
* It assumes that the client is not behind a firewall
*/
public class SSLSocketClient {
public static void main(String[] args) throws Exception
{

try {
SSLSocketFactory factory = (SSLSocketFactory)SSLSocketFactory.getDefault();
SSLSocket socket = (SSLSocket)factory.createSocket("localhost", 8443);
/*
* send http request
*
* Before any application data is sent or received, the
* SSL socket will do SSL handshaking first to set up
* the security attributes.
*
* SSL handshaking can be initiated by either flushing data
* down the pipe, or by starting the handshaking by hand.
*
* Handshaking is started manually in this example because
* PrintWriter catches all IOExceptions (including
* SSLExceptions), sets an internal error flag, and then
* returns without rethrowing the exception.
*
* Unfortunately, this means any error messages are lost,
* which caused lots of confusion for others using this
* code. The only way to tell there was an error is to call
* PrintWriter.checkError().
*/
socket.startHandshake();
// Retrieve the server's certificate chain
/* java.security.cert.Certificate[] serverCerts =
socket.getSession().getPeerCertificates();
for(int i =0 ;i < serverCerts.length ;++i)
{
System.out.println(serverCerts[i]);
}
*/

PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())));
out.println("GET http://localhost HTTP/1.1");
out.println();
out.flush();
/*
* Make sure there were no surprises
*/
if (out.checkError())
System.out.println(
"SSLSocketClient: java.io.PrintWriter error");
/* read response */
BufferedReader in = new BufferedReader(
new InputStreamReader(
socket.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
out.close();
socket.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
It works fine with hostname as www.verisign.com.But when I change it to localhost I get the following error.
I have got https://localhost:8443 to work with the browser.
javax.net.ssl.SSLHandshakeException: Couldn't find trusted certificate
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
Does anyone know how to disable the TrustStore Manager.
Thanks
Rupali Desai
[ August 13, 2002: Message edited by: rup desai ]
Hello,
I am trying to build a Jtree as follows(like in an IDE)
Clasname
Fields
Field1
Field2
and so on.
Everything works fine upto building the the child nodes for Class(like Fields Methods..)
but when I try to add Field1,Field2.. so on to Field
I get a nullpointer Exception
My code is as follows

public void addNode(String nodeName)
{

String prefix = className;
int startRow = 0;

TreePath path = tree.getNextMatch(prefix, startRow, javax.swing.text.Position.Bias.Forward);
System.out.println("path"+path);
MutableTreeNode node = (MutableTreeNode)path.getLastPathComponent();;
System.out.println("Node:"+node);
MutableTreeNode newNode = new DefaultMutableTreeNode(nodeName);
model.insertNodeInto(newNode, node, node.getChildCount());

}




public void addChild(String parentNode,String []NodeList)
{

int startRow = 0;
String prefix = parentNode;
TreeNode rootnode = (TreeNode)tree.getModel().getRoot();
String nn = rootnode.getChildAt(0).toString();
TreePath path = tree.getNextMatch(prefix, startRow, javax.swing.text.Position.Bias.Forward);
System.out.println("path"+path);
MutableTreeNode node = (MutableTreeNode)path.getLastPathComponent();
for(int i = 0 ;i < NodeList.length; ++i)
{
model.insertNodeInto(new DefaultMutableTreeNode(NodeList[i]),node,node.getChildCount());
}
}

and I am calling it this way
String superclassList[] = ClassInformation.getSuperClasses(c);
if(superclassList.length != 0)
{
addNode("SuperClass");
addChild("SuperClass",superclassList);
}
Why does the path return null at the following line in addChild()
TreePath path = tree.getNextMatch(prefix, startRow, javax.swing.text.Position.Bias.Forward);

Thanks
Rupali Desai
18 years ago
Thanks a lot that solved my problem
Rupali desai
18 years ago