?
Solved

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

Posted on 2002-05-20
8
Medium Priority
?
192 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month9 days, 18 hours left to enroll

762 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