Solved

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

Posted on 2002-05-20
8
169 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
countHi challenge 25 84
mapAB Challlenge 35 89
wordappend challenge 8 85
Eclipse Neon and jdk 1.8.0 11 72
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

760 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

24 Experts available now in Live!

Get 1:1 Help Now