Alice Wong

Greenhorn
+ Follow
since Oct 12, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Alice Wong

Hi,

I'm new to JasperReport. I'm now making use of JasperReport in a Servlet to generate a chart with data from an external DataSource(say from Oracle). I also use iReport to design my report.

I have found out two approaches to generate charts:
1. i. Query the database in the Servlet, generate the chart and render into an java.awt.Image object.
ii. Define a parameter of type java.awt.Image. Create an Image object in the report template and set its image expression as the parameter defined previously.
iii. Pass the image created in the Servlet as parameter to the report.

2. i. Define the database query in iReport.
ii. Create a Chart object in the report template. Set the data series of the Chart object to be the Report Fields generated by the query.
iii. Include the scriptlet class generated by iReport in the webapp.

Which approach is better? Thanks in advance!
Hi, I'm new to Weblogic

I've got an application which is runnable on Websphere and Tomcat. Now I would like to deploy the application in Weblogic 7.0.

1. Is there any good tutorial on such migration?
2. Is it a must that I create a weblogic.xml? Can the web.xml be shared among these three containers?
3. After deployment, where are the jsps and classes are stored in weblogic?

Thanks in advance!

Alice
19 years ago
Hi,

How can I disable the key? I have successfully captured the keycode (91) but can't disable it either by:
-window.event.returnValue = false;
-override by another keycode

Thanks,
Alice
Hi,

I've solved the problem by using the code below:

if ((window.event && window.event.keyCode == 114) ||
(window.event && window.event.keyCode == 116) ||
(window.event && window.event.keyCode == 122)) {
window.event.keyCode = 38; //up arrow
window.event.returnValue = false;
return false;

}
Hi,

I have the following js file included in my HTML page in order to avoiding triggering the functions of F3, F5 and F11:

document. nkeydown=disableKey;

function disableKey() {
switch (Number(event.keyCode)) {
case 114: //F3
case 116: //F5
case 122: //F11
event.keyCode = 38; //override by up arrow!
}
}

The code runs fine when the focus is not in any input of the HTML page. When I focus onto any input and press those function keys, the functions of those keys are still triggered. I have checked that the keyCode are correctly captured. Any recommendations? Thanks in advance!

Alice
Hi Eric,

I cannot use onunload/onbeforeunload because the user may navigate to other pages in the site. I cannot run the logout script when this page is unloaded when navigating to other pages unless he presses the logout button or exit the window.

Any ideas? Thanks!

Alice
Hi,

I would like to run some logout script when the IE exits( or the [x] button on the top right of IE is pressed). The script works and is something like:

function onClose(formObj){
formObj.action ="logout.do?reqAct=logout" ;
formObj.submit();
}

However I simply cannot use <body onUnload="javascript nClose()">. How can I capture the window close event?

If this doesn't work, is there any method to disable IE from closing except that the logout button is clicked?

Thanks a lot!
Nick, just wanna tell you that I've solved the problem simply by re-installing the Tomcat! Sounds amazing, right?
20 years ago
Nevermind! =) Thanks for your help!
20 years ago
Nick,

No...I'm just thinking of trying to build the project with UTF-8 as encoding. Do you know where can I set that in Eclipse?
20 years ago
I test the other way round....If i explicitly load hello.jsp (with the code for fetching properties from Form Bean removed), the encoding is UTF-8.
I'm wondering whether the encoding of my Form Bean is not correct. I'm now using Eclipse to edit and build my application. Should I explicitly set the encoding in Eclipse?
20 years ago
request.setCharacterEncoding("UTF-8"); <- this has already been put inside the filter class
20 years ago
Thanks Nick. Unfortunately that doesn't work for me.
I'm now using Tomcat 5.0 and have set a filter for character encoding in my web.xml in my application:

<filter>
<filter-name>Set Character Encoding</filter-name>
<filter-class>com.web.common.filter.SetCharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Set Character Encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

The filter class is simply downloaded from Apache.
Any idea on why the encoding is not correct? Thanks!
20 years ago
I'm using Tiles to define my page:
<definition name=".userList" extends=".mainLayout">
<put name="browser-title" value="Hello" />
<put name="body-content" value="/hello.jsp" />
</definition>

in hello.jsp and mainLayout.jsp, I have put the line
<%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" language="java" %>

however, when I load the page, the encoding is Western European. Have I missed out any settings that may affect the encoding? Thanks!
20 years ago
I am developing a web application using Struts + Tomcat + Apache. My database is Oracle 8i with NLS as WE8DEC and my JSPs are using Unicode. My problem is how can I correctly update the database and retrieve data from database? Is there any settings that can be done in Tomcat? Any library that I can use? Thanks!