Solved

jsp accessing a bean using websphere studio

Posted on 2002-03-13
3
247 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
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 50 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

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

Suggested Solutions

Title # Comments Views Activity
Apache server configuration 7 92
maven project jars 7 58
java operators 3 125
designing in object programming 12 107
Original post  on Monitis Blog. Web performance monitoring is broken into two camps: passive and active. Passive monitoring is defined as looking at real-world historical performance by monitoring actual log-ins, site hits, clicks, requests for…
This article was originally published on Monitis Blog, you can check it  here . If you have responsibility for software in production, I bet you’d like to know more about it. I don’t mean that you’d like an extra peek into the bowels of the sour…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

726 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