Solved

jsp accessing a bean using websphere studio

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
logging jar 1 110
Apache server configuration 7 85
unit test DAO layer 1 137
main method of string class 3 110
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
As a business owner, there are many things that keep you up at night. Profit margins, employee retention, human resource protocols, whether your product or service will remain competitive. When you own or manage a technology company that operates la…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

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