Solved

jsp accessing a bean using websphere studio

Posted on 2002-03-13
3
242 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
3 Comments
 

Author Comment

by:nmasterson
Comment Utility
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 50 total points
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
A safe way to clean winsxs folder from your windows server 2008 R2 editions
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

728 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

9 Experts available now in Live!

Get 1:1 Help Now