jenny wang

Greenhorn
+ Follow
since Feb 23, 2001
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 jenny wang

ryan:
Thanks for your respond. My servlet code is running in JRUN which is installed in a SUN Enterprise Server. I got error message when I try to see it in Internet Explorer in my computer(WindowNT).
I am not sure how to setup X11 in UNIX server. Can you tell me how to configure it or how to setup DISPLAY variable? I will really appreciate your help.
jenny
22 years ago
I create an Image using JAVA Graphics2D API.
The code is running well in Windows. But I got the following error in UNIX server. It seems that it has trouble with X11 window. Anybody knows how to solve this problem?
Thanks in advance!
jenny
Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:59)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:58)
at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1011)
22 years ago
I create an Image using JAVA Graphics2D API.
The code is running well in Windows. But I got the following error in UNIX server. It seems that it has trouble with X11 window. Anybody knows how to solve this problem?
Thanks in advance!
jenny
Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:59)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:58)
at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1011)
22 years ago
William:
Thanks a lot for your code correct. Actually I did change the code to see the difference. But I still get error message after moving code from one server to another server(Jrun3.1 with Iplanet web server). The error message is as followed:
/test/TestServlet
java/lang.IllegalArgumentException: URI is null
at allaire.jrun.servlet.JRunSE.getRequestDispatcher(JRunSE.java:1937)
at TestServlet.doPost(TestServlet.java:69)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760);
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1416)
at allaire.jrun.session.JRunSessionService.service(JRunSessionSevice.java:108)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:1270)
at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:76)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1552)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1554)
at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:364)
at allaire.jrun.jrpp.ProxyEndpoint.run(ProxyEndpoint.java:388)
at allaire.jrun.ThreadPool.run(ThreadPool.java:272)
at allaire.jrun.WorkerThread.run(WorkerThread.java:75)
Any idea?
jenny
22 years ago
I have a servlet which handles infomation from several pages and forward result to jsp pages. But I got problem with IE browser.
It doesn't go to next page. I put object in the session at mainpage and rechieve the object at every following page.
//main page in doPost method
RequestDispatcher rd=null;
String next;
HttpSession session = req.getSession(true);
String sessionID = session.getId();
session.setAttribute(sessionID,MyObject);
if(MyObject.getType()==2)
next = "/2ndpage.jsp";
else
next="/3rdpage.jsp";
rd = getServletContext().getRequestDispatcher(next);
rd.forward(req, res);
//2nd and 3rd page
HttpSession session = req.getSession(true);
MyObject = (MyObject)session.getAttribute(session.getId());
//inside jsp page
<%@ page language="java" import="MyObject" session="true" %>
MyObject = (MyObject)session.get(session.getId());
I am using JRUN as my java application server and Iplanet server as web server. I believe there are many java experts in this JAVA salon. If somebody can point out the problem in my code I will appreciate your help. I will post more codes here if you need more details to understand the question.

jenny

22 years ago
I am using Jrun server3.0 which is connected with Iplanet server.
I want to put all the .jsp files in Iplanet docs directory and rest of .java files in the Jrun default server directory.
Does anybody know how to redirect jsp files inside the servlet?
As far as I know, RequestDispatcher is used only under the servlet relative path and not for absolute path. I tried sendRedirect() and it seems it doesn't work either.
It will be great if somebody could give some hints on this.

Jenny
22 years ago
I have an old Jrun server2.3.3. But I am not sure about its directory structure(I even can't find docs configuration line). I have a servlet file and several jsp files. I wonder which file I should configure and where should I put jsp files?
jenny
22 years ago
Who is using JRUN server2.2?
I have a emergent question about configuration file!!
Any help will be appreciated.
Jenny
22 years ago
I have a question about JRUN server.
I have several java files(servlets and beans) want to test them in the JRUN server. For management purpose, can I jar all the files and put it into somewhere and JRUN server could load it automatically? I think I need to configure the property file. But I can't find useful information in docs. Can anybody give some hints?
Thanks.
Jenny
22 years ago
Can anybody tell me why(the reason) C is right for following question?
The following code will print
1: Double a = new Double(Double.NaN);
2: Double b = new Double(Double.NaN);
3:
4: if( Double.NaN == Double.NaN )
5: System.out.println("True");
6: else
7: System.out.println("False");
8:
9: if( a.equals(b) )
10: System.out.println("True");
11: else
12: System.out.println("False");
A) True
True
B) True
False
C) False
True
D) False
False
Jenny
well, my original question is getting decimal number but NOT ROUND it which means 11.4765 should get "11.47" instead of "11.48".
jenny
22 years ago

I have decimal numbers as
"10.35009", "11.4765",
I need a method to format these two numbers into
"10.35" and "11.47".
Thanks in advance!
Jenny
22 years ago
Thanks so much!
Your guys are so helpful! It solves my problem.
jenny
22 years ago
I have a question regarding utility.
I get bunch of numbers and I want to order these numbers.
When I use TreeSet. It works like this way:
[0.35, 1.45, 23.34, 34.22, 5.89, 9. 29]
but I want they look like:
[0.35, 1.45, 5.89, 9.29, 23.34, 34.22]
Then I try to use TreeMap. But since TreeMap needs a pair-key and value. I only have a group of numbers and there is possibility that numbers can be same. so numbers can't be key in the TreeMap.
It seems a very simple problem. But I just couldn't find a appropriate utility which can easily solve this problem.
Thanks for any suggestion!

Jenny
22 years ago
I add a "System.out.println" message in servlet file and it showed up in command window(Tomcat) when I click on aplet. But I just can't get the object transfered from applet.
I wonder if there is something I didn't notice.
Thanks, Bill. I will try your way again. I will post here if I find out anything.
Jenny

22 years ago