Link to home
Start Free TrialLog in
Avatar of Haho
Haho

asked on

JSP / Javabean problem on IBM Websphere / Windows 2000/jdk1.2

dear experts,

Is there any errors with the JSP code below ?
I get a blank page when I include (A) below, but the code runs OK if I exclude (A) below. I want to assign "Record_item.getEventTyp()" to an integer value.
Thanks,

---------------------------------------------------------
<jsp:useBean id="Record_coll" class="com.aaa.bbb.webapp.view.EventHistoryView" scope="request"/>
<jsp:useBean id="Record_item" class="com.aaa.bbb.vo.EventHistoryData" scope="request"/>
...html...
<%  
     int rec_size = Record_coll.getHistorySize();
     if (rec_size > 0)     {
%>
...html...
<%      for(int i=1; i <= rec_size; i++) {
        Record_item = Record_coll.getHistoryAt(i-1);    
     if (i % 2 == 0) {  
%>
...html...
<%
         int revent1 = Record_item.getEventTyp(); <---(A)
%>
...html...
Avatar of Venci75
Venci75

Whet is the code of the
com.aaa.bbb.vo.EventHistoryData
class?
Avatar of girionis
 Are you getting any error messages?
Avatar of Haho

ASKER

Info about EventHistoryData Class
-----------------------------------------------
package com.aaa.bbb.vo;
import java.sql.*;
 
public class EventHistoryData extends DataBean implements java.io.Serializable {

     private String eventTyp        = "";
...
public java.lang.String getEventTyp() {
     return eventTyp;
}
...
------------------------------------------------

tried using revent1 as string, also a blank html page comes out (checked the source, only the header appears, no <body>....)

Futher down there is a code ... <%=Record_item.getEventTyp(); %> which displays out correctly.

Cannot figure out why <%=Record_item.getEventTyp(); %> displays correctly BUT assigning it to a variable i.e.
<% string revent1 = Record_item.getEventTyp(); %>
results in a blank page..!??

How do i do basic JSP debugging in this case?
Thanks!
if you attach to the webserver's jvm using JPDA you would be able to debug the generated JSP java file like any other file.  I'd look for the generated java file in: websphere_base_dir\temp\appserver_name\app_name\JSP_??\your_jsp_??.java
change line A to:
int revent1 = Integer.parseInt(Record_item.getEventTyp());
ASKER CERTIFIED SOLUTION
Avatar of Venci75
Venci75

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What does you WebSphere error log say?
Avatar of Haho

ASKER

sigh... it was the "S" and the "s"... :(
Thanks!