Solved

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

Posted on 2002-05-20
8
172 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
 
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
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 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
backtracking recursion  code 19 54
JUnit 4 @Before and @BeforeClass differences 3 48
rhino JavaScript import, load 25 67
java jdbc batch example 8 22
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now