Solved

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

Posted on 2002-05-20
8
176 Views
Last Modified: 2010-03-31
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...
0
Comment
Question by:Haho
8 Comments
 
LVL 9

Expert Comment

by:Venci75
ID: 7021328
Whet is the code of the
com.aaa.bbb.vo.EventHistoryData
class?
0
 
LVL 35

Expert Comment

by:girionis
ID: 7021363
 Are you getting any error messages?
0
 
LVL 1

Author Comment

by:Haho
ID: 7021732
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!
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 1

Expert Comment

by:nixj14
ID: 7021752
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
0
 
LVL 9

Expert Comment

by:Venci75
ID: 7021753
change line A to:
int revent1 = Integer.parseInt(Record_item.getEventTyp());
0
 
LVL 9

Accepted Solution

by:
Venci75 earned 50 total points
ID: 7021775
>>Cannot figure out why <%=Record_item.getEventTyp(); %> displays correctly BUT assigning it to a variable
i.e.
>> <% string revent1 = Record_item.getEventTyp(); %>

are you sure that you used exactly this line?
java is case sensitive. The correct name of the string class is 'String' - not 'string'
0
 
LVL 3

Expert Comment

by:jerelw
ID: 7022150
What does you WebSphere error log say?
0
 
LVL 1

Author Comment

by:Haho
ID: 7023188
sigh... it was the "S" and the "s"... :(
Thanks!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
groupNoAdj 7 95
table example 4 29
servlet example 11 40
Java exception bubble up 2 18
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question