?
Solved

jsp accessing a bean using websphere studio

Posted on 2002-03-13
3
Medium Priority
?
249 Views
Last Modified: 2012-05-04
HI

i am having a problem.... i have written a bean which will access a db2 table and retrieve some data from it. I have a html page where the user can enter a number which equates to the primary key for the search.... it then calls a jsp which should access the bean and publish the results.

That at least is the objective. However we are doing this in conjunction with Websphere studio and this is where the confusion starts. My class files are in the installedApps/WEB-inf directory of the AppServer as is my jsp file. My html file calls the jsp fine but i dont get any results.....

Am i missing something - should i add my bean to some xml file to make sure it gets loaded by the appserver?

I have added a line that will tell me the server time (this is in my jsp page) -- i will attach it --> but this just outputs : The server time is new java.util.Date()
IS there something missing on my jsp page that is needed to pick up these tags?

Heres hoping someone can help!!
thanx
NM
0
Comment
Question by:nmasterson
[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
3 Comments
 

Author Comment

by:nmasterson
ID: 6860160
oops - forgot to attach the jsp page :


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META name="GENERATOR" content="Microsoft FrontPage 4.0">
<META http-equiv="Content-Style-Type" content="text/css">
<TITLE>Product Details</TITLE>

<%@ page language="java" buffer="none" isThreadSafe="true" session="true" %>
<%@ page import="java.io.*" %>
<%@ page import="javax.servlet.jsp.*" %>
<%@ page import="com.du.*" %>

<jsp:useBean id="SelectProduct" class="com.du.bean.SelectProduct" scope="request">
<jsp:setProperty name = "SelectProduct" param ="productId" property="id"/>
</jsp:useBean>

</HEAD>
<BODY>
<!-- CONTENT TO BE INSERTED HERE -->    
The server time is <jsp:expression> new java.util.Date() </jsp:expression>
The Product ID is:
     <%
     // Get product
     SelectProduct.setId(request.getParameter("productId"));
     SelectProduct.executeSQL();
     SelectProduct.setRow(1); // set a row - would need to put this in a loop to loop through the record set
     %>
     
     <!-- set the coulmn you want to retrieve -->
     <%SelectProduct.setNamedColumn("PartNum");%>
     <!-- get the data value for the column (and in this case out.print to screen) -->
     <%=SelectProduct.getNamedItem()%>

<!-- END OF CONTENT TO BE INSERTED HERE -->          
</BODY>
</HTML>
0
 
LVL 6

Accepted Solution

by:
kotan earned 150 total points
ID: 6879031
The jsp files should be located in installedApps/ not installedApps/WEB-INF/.

installedApps/WEB-INF/classes/   - for java classes
installedApps/WEB-INF/lib/    - for jar files
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6958074
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if still open in seven days.  Please post closing recommendations before that time.

Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20285317.html
http://www.experts-exchange.com/questions/Q.20269444.html
http://www.experts-exchange.com/questions/Q.20276299.html
http://www.experts-exchange.com/questions/Q.20282011.html




*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations if this item remains inactive another seven (7) days.  If you are interested in the cleanup effort, please click this link http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643 
POINTS FOR EXPERTS awaiting comments are listed here -> http://www.experts-exchange.com/commspt/Q.20277028.html
 
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange
0

Featured Post

Technology Partners: 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

This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
What's worse than having your data encrypted by ransomware? Getting attacked by a so-called "wiper," which simply destroys the data and offers you no hope of ever seeing it again.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month12 days, 15 hours left to enroll

777 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