JSP referencing a package
Hi All,
I'm making an application for a uni assignment which uses JSP and in the index.jsp file i'm trying to use the import statement to reference a particular class which is located in the bank.util package, but I keep getting the following error:
org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error:
[javac] C:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-apps\Assignment\war-ic_war\org\apache\jsp\index_jsp.java:11: package bank.util does not exist
[javac] import bank.util.CustomerDetails;
[javac] ^
[javac] 1 error
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:88)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:337)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:429)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:489)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:468)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:516)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:307)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
The CustomerDetails class does have the following statement in it:
package bank.util;
my folder and file structure is like this:
/bank/util/CustomerDetails.java
The index.jsp file is located in the bank folder. So I thought that by saying import bank.util.*; that would work no problems but it doesn't.
If anyone has any ideas as to what the problem might be I'd be grateful. Thanks in advance.
Thanks.
Simon
JSPs and .java source files don't share the same space.
You have to
- compile the .java files to be .class files
- copy the classes into the WEB-INF/classes directory.
The directory of your web app should look something like this:
/myApp
index.jsp
WEB-INF
- classes
- bank
- util
- CustomerDetails.class
Similar Messages
-
Cannot load a library unit database_object ( referenced by package name )
Dear Friends,
I am using Plls in Reports 6i. In One of the Pll I am Using
Backend Table in package body. I have two 8i instances. when I
comiple and save and close this plls with one instance( say
instance "A" ), its fine. it is done sucessfully. Now i am
connecting to other instance ( say instance "B" ) and open that
same pll. it is showing compilation error "Cannot load a library
unit <my_table> ( referenced by <package name> )". Now I compile
and save and close with instance "B". it is done sucessfully.
Again I am connecting to Instance "A" and open that same PLL. It
is showing same Error "Cannot load a library unit <my_table> (
referenced by <package name> )"
Anybody can tell me , How to get rid of this Problem. I dont
know its a BUG or somthing else.
I am using Window2000 as OS.
Thanks
Ashish ParikhIf a Schema has some objects in it, then you cannot drop that Schema until you remove all the objects out of it. You can change the schema owner
to another database principal and drop the user like,
Alter Authorization ON Schema::username TO DBO; Drop User username;
other option would be
Transfer the username schema objects to a different schema and drop username schema and user like.
Alter Schema DBO Transfer Username.[OBEJECTNAME] ;
--need to repeat this until you transfer all objects under this schema
Drop Schema username;
Drop User username;
Regards,
Praveen D'sa
MCITP - Database Administrator - 2008
sqlerrors -
"import" in the JSP's Page directive - referencing a package
I have my JSP file in WEB-INF. And my .Java file in the "Project parent folder"/src/com/user/faq.
My Page directive in the JSP looks something like,
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" errorPage="errorPage.jsp" import="com.user.faq.FaqCategories"%>
And JSP won't compile, saying com.user.faq.FaqCategories is not found.
Any help on this will be appreciated. Thanks!JSP won't compile, saying com.user.faq.FaqCategories is not foundSo it isn't on the classpath when compilation occurs. So fix that.
-
Problem with JSP using bean packaged in jar file
Hi,
I am trying to use a java bean in a jsp file. The java bean is packaged
into a jar file. I am getting class not found compilation error. If the
bean remains to be a seperated class file, everything work well.
Does anyone know how I can use bean in a jar file within jsp , i.e. to
allow the bean to be found during compilation ?
Thanks,
Terence.
[email protected]
Jacek,
Thanks for replying.
My JSP's are just files in my document root . However, I found a solution to
my
problem. That is to have the jar file defined in my weblogic.class.path. I may
have missed some files in my original jar file which causes my problem.
Mayby I should package everything into a web application for deployment. That
will be my next step.
Thanks anyway.
Terence.
Jacek Laskowski wrote:
> Terence Lai wrote:
> >
> > Hi,
> >
> > I am trying to use a java bean in a jsp file. The java bean is packaged
> > into a jar file. I am getting class not found compilation error. If the
> > bean remains to be a seperated class file, everything work well.
>
> How do you use the JSP file ? Is it a part of web application ? If so,
> the bean jar package should be located in WEB-INF/lib directory. It's
> also recommended to put the bean class into a package, so it's not in
> 'unnamed' package, and <jsp:useBean> can find it.
>
> >
> > Does anyone know how I can use bean in a jar file within jsp , i.e. to
> > allow the bean to be found during compilation ?
>
> see above.
>
> > Terence.
>
> Jacek Laskowski
> HP Consulting
-
Java-JSP working with packages and classes
Hi everybody,
I'm bearly new on Java-JSP developping and I wanted to know how Tomcat (for example) manage the imported packages and classes.
The fact is I'm working on a project ('/bob') which use some packages that I don't see in the '/bob' directory. So, is that possible that '/bob' is downloading packages and classes from Internet to '/bob/download' virtual repertory and use it? If it is true, is it possible to override this download by making '/bob' project using local packages or classes (example : com.boblibrary.classes.util in '/bob/WEB-INF/classes/com/boblibrary/classes/util') instead of downloading it?
Therefore, the '/bob' project is using bugged classes (that I think it downloads from Internet) which I can't correct.
Thanks for your help.
- RenaudThank you for your answer, but I can't imagine where is physicaly the class that my project use and show me as http://localhost:8080/atlassian-jira-3.13.2/download/ressources/br.com.ecore.jira.plugin.projectViewPlugin:ProjectViewTabPanel/js/projectviewtabpanel.js. Where is that Javascript file suppose to be on my hard drive? Or where is that class 'br.com.ecore.jira.plugin.projectViewPlugin' suppose to be on my hard drive? If it is not dowloaded from the Internet.
I have no trace of that class on 'atlassian-jira-3.13.2/', neither on 'jdk1.6.0_18/', 'jre6/' or 'apache-tomcat-5.5.28/common/classes/'.
Thanks. -
JSP'S and Packages!!!!
I'm developing a Web application using Java and Oracle. The system administrator has set up a development instance on Websphere (I don't have admin rights to this server) called MEDS for my projecct. The directory where my jsp files are is: MEDS/MEDS.war/jsp/...jsp files. My Servlet files are in the following directory: MEDS/MEDS.war/WEB-INF/classes. I want to put my database connection string into 1 servlet file, create a package, and then include my servlets and jsp's into that package.
How can I create a package, let's say MEDSPACKAGE, and include my jsp files and servlets in that package? After I've created that package, what statement do I use in each of my jsp pages to include them in that package that I create?
Thank you in advance!!!!There are also tools that will make this easier for you (such as your IDE or Ant, but each will have a learning curve associated with them. Please, PLEASE take the time to read about the basics in the previous link I posted. You (and your admin) will thank you. :o)
§ -
How to call class file from jsp without creating packages
i m using tomcat 5.5
i stored my class file into WEB-INF\Class directory
how to call that class file. from my jsp page.
i got some error.
i used package concept,that works fine.i m using tomcat 5.5
i stored my class file into WEB-INF\Class directory
how to call that class file. from my jsp page.
i got some error.
i used package concept,that works fine.Then use packages.
As of Java1.4, you can no longer import classes from the default package (no package declared) into classes that are packaged.
All Tomcat classes are in packages, including the compiled JSP.
Therefore: Your classes need to be in a package inorder to be imported and used by the JSP.
Why the problem? If you know it works with packages, why try not to use them? -
How can I locate EBS FND security java classes being referenced from packages?
Hi All,
I need to load few java classes in database whose methods are being called from SQL packages. For example, package FND_WEB_SEC calls methods from java class "oracle.apps.fnd.security.WebSessionManagerProc"
Which means I need to load this class on my db for it to be used correctly.
I am unable to locate this and few other java classes.
Can anyone suggest where can I find these?
Thanks,
IshwarHi Ishwar,
Please have a look at the forum search, as it would be of assistance..
Forum Search: Where are Java classess
Best Regards, -
Problem Referencing a Package in an 11g DB From Forms 6i
Hello everybody,
I have recently updated a database from 8i to 11g. This DB is used alongside with a program that it has been created with Forms-Reports Developer 6i. Even though the overall performance and usage of the program seems intact I came upon a problem that I cannot solve.
In a form there is a reference to a package of the database that doesn't work anymore. For example something like PackageName.ProcedureName(Parameter1,Parameter2) gives the following error:
"PDE-PSD001 Could not resolve reference to <Unknown Program Unit> while loading Procedure Body [..]"
I have checked the name and spelling of the package in my Db and in the form call but that didn't seem to work. The package compiles inside the DB and has no problem but the form refuses to reference it. When I connect to the old 8i DB it works fine. I have tried recreating the package in 11g from scratch but with no success.
Any ideas?Any help would me much appreciated...
Thank you in advanceI have recently updated a database from 8i to 11g. This DB is used alongside with a program that it has been created with Forms-Reports Developer 6i. Even though the overall performance and usage of the program seems intact I came upon a problem that I cannot solve.
I hope yours is not a production environment (yet).... did you check MOS doc ID 207303.1 Client / Server / Interoperability Support Between Different Oracle Versions before upgrading your database ?
Forms 6i is an 8.0.6 version, which has never been supported for 11g database. Which, as always, doesn't mean it won't ever work, it may work 99% of the cases, then you run into a situation like yours...... -
Problem Accessing Class in my package from jsp file
Hi,
I am using Apache tomcat server and i have made package which contains a class for database connection. I have imported this package in my jsp file but when i run the jsp tomcat gives the class not found exception. i have placed the jsp file in /webapps/my_project/ folder and the package in the /webapps/my_project/WEB-INF/classes/ folder.
Still its not working.
Please help me out!!!!!!!!hi,
Thanks for ur reply. You have guessed it right, i dont have a .jar file its a .class file in a package subfolder. I have tried out ur suggestion but it didnt work. The following error i shown when i run it.
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
C:\Apache Tomcat 4.0\work\localhost\_\College\test$jsp.java:4: Package college_lib not found in import.
import college_lib.*;
^
1 error, 1 warning
Here, College_lib is the package name which contains the class my class file
Is there any problem with my Apache Tomcat4.0 or any other thing.
Message was edited by:
Despo -
URL Mapping for packaged JSP's in web.xml file
Hi,
I am using weblogic6.0sp2 enterprise edition.I have my JSP's in package structure.
Suppose my login.jsp is in package com.advice.document. So for URL mapping in
web.xml what should be given so that by giving that my JSP runs. I have tried
many options but not got success.
Here is my web.xml file..
<web-app>
<servlet>
<servlet-name> Login </servlet-name>
<jsp-file> com\advice\document\login.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name> Login </servlet-name>
<url-pattern> /Login</url-pattern>
</servlet-mapping>
</web-app>
If any body knows or have worked on the same then let me know.
Thanks in advance.
--- Vipul
Did you try specifying the jsp-file with forward slashes (e.g.,
com/advice/document/login.jsp)?
Vipul Garg wrote:
> Hi,
> I am using weblogic6.0sp2 enterprise edition.I have my JSP's in package structure.
> Suppose my login.jsp is in package com.advice.document. So for URL mapping in
> web.xml what should be given so that by giving that my JSP runs. I have tried
> many options but not got success.
> Here is my web.xml file..
> <web-app>
> <servlet>
> <servlet-name> Login </servlet-name>
> <jsp-file> com\advice\document\login.jsp</jsp-file>
> </servlet>
> <servlet-mapping>
> <servlet-name> Login </servlet-name>
> <url-pattern> /Login</url-pattern>
> </servlet-mapping>
> </web-app>
>
> If any body knows or have worked on the same then let me know.
> Thanks in advance.
> --- Vipul
-
JSP - not recognizing a package
I'm trying to import the javax.servlet.jsp.* and javax.servlet.jsp.tagext.* packages but I get an error when I compile that states that they don't exist.
I installed Tomcat4 and the JDK so I'm assuming that they should already be there.
Any ideas??Hmm...I found servlet jars in the following directories:
In \jakarta-tomcat-4.0.1\common\lib:
servlet.jar
In \jakarta-tomcat-4.0.1\server\lib:
servlets-invoker.jar
servlets-manager.jar
servlets-default.jar
servlets-snoop.jar
servlets-common.jar
According to the Tomcat installation doc, this is where the jar files should be, right? I'm not sure what other classpath they should be in. -
Package related: servlets - jsp
Hi!
I have built a WebApp with servlets only - now I want to add a few JSPages. but I can't instantiate any classes or call any servlets' (static) methods, because they are not public, but only visible to the package all the servlets of my WebApp belong to!!!
Can I make a JSP join a package???
Or what do you recommend?
any hint appreciated
thanks
michiAny custom defined methods that are common to all servlets/JSPs should not be coded in any one servlet rather they should be defined in a separate file which exposes these methods as public for all to share. Note that I said custom defined methods. These are methods that do not belong to the standard servlet class and are not part of the class hierarchy. In other words, methods that you created to extend functionality such as methods that obtain database connections, write to log files, or maintain generic audit trails. I would consider breaking these types of methods out of existing servlets to improve the overall design of the application.
If this is not possible then I would suggest creating a type of mediator object that exists in the same package as the servlets and exposes the necessary methods as public members and delegates all processing to the methods in the servlets. In other words, class mediator lives in the custom.java.servlet package and defines public methods foo() and bar(). These methods call foo() and bar() in custom.java.Foo and custom.java.Bar servlets respectively. This is not the best overall design however. -
Hi all.
Just a quick question that I can't find an answer to.
Is it possible to put jsp files into packages? For example, say I want to have two JSPs with the same name, can I do something like:
com.somepackage.Login.jsp
and
com.someotherpackage.Login.jsp
rather than just putting them all in the webapps/myapp directory?
And if so, how do I configure Tomcat, and how do I reference each one?
Many thanksHi all.
Just a quick question that I can't find an answer
to.
Is it possible to put jsp files into packages? For
example, say I want to have two JSPs with the same
name, can I do something like:
com.somepackage.Login.jsp
and
com.someotherpackage.Login.jsp AFAIK, no.
rather than just putting them all in the
webapps/myapp directory?
You could ofcourse put them in sub-directories under myapp and not necessarily directly under myapp. So if you put your jsps under a folder
, say, jsp which in turn is under the root folder myapp, they should be
accessed as /jsp/filename.jsp. You could logically partition the jsps
into sub-folders and say, you have folders like foo and bar inside your
jsp folder, then the jsps would be accessed as /jsp/foo/filename.jsp and /jsp/bar/filename.jspAlternatively you could define a url for each jsp in your web.xml, just like
how you do for servlets. For this use the <jsp-file> tag in place of
<servlet-class> in your web.xml.
By doing so, you register a JSP as a servlet using the <servlet> tag. In this example a URL containing /main will invoke myJSPfile.jsp:
<servlet>
<servlet-name>myFoo</servlet-name>
<jsp-file>myJSPfile.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>myFoo</servlet-name>
<url-pattern>/main</url-pattern>
</servlet-mapping>Registering a JSP in this manner allows you to specify the load order, initialization parameters, and security roles for a JSP, just as you would for a servlet.
cheers,
ram.
>
Many thanks -
Need help on Modifying Jsp Code to establish relationships in iStore.
I am currently working on iStore an internet enabled product
from Oracle.
In iStore one can establish relationships between products like
cross sell , complimentary, substitute, conflict etc. However at
the moment only one relationship works i.e: Related. This is
because this is a bug in iStore. Only the relationship Related
is defined in the jsp. We have been asked to modify the jsp
ibeCCtdItemDetail.jsp
Please find pasted below the jsp which only had the arrays for
related i.e: relitems and service i.e service have added the
array complimentary to establish such a relationship and pasted
the relitems code once again and changed relitems to
complimentary. I am stuck up on this since the past 2 weeks i
would appreciate if anybody could help.
<%@include file="jtfincl.jsp" %>
<!-- $Header: ibeCCtdItemDetail.jsp 115.24 2001/06/16 15:21:05
pkm ship $ -->
<%--
=================================================================
========
| Copyright (c)2000 Oracle Corporation, Redwood Shores, CA
| All rights reserved.
+================================================================
===========
|
| FILE
| ibeCCtdItemDetail.jsp - Item Detail display
|
| DESCRIPTION
| Displays Item Detail page. Item's description, long
description, large
| image, flexfields, available services, and related items
are displayed.
| The list price and best price (selling price) for each of
the Item's
| available units of measure is displayed. Displays Add to
Cart,
| Express Checkout, Configure buttons (if appropriate).
|
| PARAMETERS (SOURCE)
| party Id IN (RequestCtx) - user's party
id
| account Id IN (RequestCtx) - user's
account id
| currency code IN (RequestCtx) - currency code
| item IN (URL) - Item ID
| section IN (URL) - section ID of
section we are
| coming from
(optional)
| item IN (pageContext) - Item ID
| section IN (pageContext) - Section ID
| qty IN (pageContext) - Quantity
entered by user
| uom IN (pageContext) - UOM selected
by user
| errorMsg IN (pageContext) - error message
from buy
| routing page
| * pageContext attributes for "item" and "section" are used
when the URL
| does not contain valid values for "item" and "section"
(such as when an
| error occurred in the buy routing page and the request is
forwarded
| back to this page)
|
| oneclick_obj OUT (pageContext) - OneClick
object containing
| user's
Express Checkout
| preferences
| postingID OUT (pageContext) - Integer
posting Id, for
| iMarketing
integration
| itemIDs OUT (pageContext) - int[] itemIDs
on the page
| (for use by
postings)
| numRequested OUT (pageContext) - Integer
number of postings,
| for
iMarketing integration
| random OUT (pageContext) - Boolean
whether to randomize
| posting
retrieved, for
| iMarketing
integration
| type OUT (HTML form) - "single" (1
item)
| item OUT (HTML form) - Item ID
| refpage OUT (HTML form) -
"ibeCCtdItemDetail.jsp" plus any
| parameters
needed to return
| to this page
in case of error.
| uom OUT (HTML form) - UOM code
selected by user
| qty OUT (HTML form) - quantity
entered by user
| Add to Cart.x OUT (HTML form) - user clicks
Add to Cart
| 1-Click.x OUT (HTML form) - user clicks
Express Checkout
| Configure.x OUT (HTML form) - user clicks
Configure
|
| OBJECTS REFERENCED
| oracle.apps.ibe.catalog.Item
| oracle.apps.ibe.order.OneClick
|
| APIs REFERENCED
| Item.getItemID() - get Item ID
| Item.getDescription() - get item description
| Item.getLongDescription() - get item long description
| Item.isConfigurable() - whether item has
configuration UI set up
| Item.getFlexfields() - get Item flexfield
prompts and values
| Item.getRelatedItems() - get related items and
service items
| Item.getMediaFileName() - get media based on
display context
| OneClick.loadSettingFrDB() - load Express Checkout
settings for
| current user
|
| JSPs REFERENCED
| ibeCCtpPostingI.jsp - set iMarketing
parameters (include)
| ibeCCtpSetItem.jsp - retreive and set item
information (include)
| ibeCCtpItmDspRte.jsp - Item display routing
page (link)
| ibeCCtpBuyRoute.jsp - Buy routing
page (form POST)
| ibeCCtdSctPath.jsp - Path Traversed
Display (include)
| ibeCXpdShowTag.jsp - Express Checkout Tag
Area (include)
| ibapstng.jsp - iMarketing integration
page (include)
|
| ADDITIONAL NOTES
| iMarketing posting ID can be changed by editing file
ibeCCtpPostingI.jsp
|
| HISTORY
| 08/01/2000 auyu Created.
| 04/09/2001 auyu Added compile-time include for retrieving
item
| information
|
+================================================================
=======--%>
<%@page import="oracle.apps.ibe.order.*" %>
<%@page import="oracle.apps.ibe.catalog.*" %>
<%@page import="oracle.apps.ibe.store.*" %>
<%@page import="oracle.apps.jtf.displaymanager.*" %>
<%@page import="oracle.apps.jtf.base.Logger" %>
<%@page import="oracle.apps.jtf.minisites.*" %>
<%@include file="ibeCZzpHeader.jsp" %>
<%@page import="oracle.jdbc.driver.*" %>
<%@page import="java.sql.*" %>
<%-- declaration --%>
<%!
/* Retrieve parent section ids for a given item.
* int itemId - Item whose parent section ids will be retrieved
int getParentSectionId(int itemId)
int parentSectionId = -1;
Connection conn = null;
OraclePreparedStatement stmt = null;
ResultSet rs = null;
try {
BigDecimal minisiteId = RequestCtx.getMinisiteId();
conn = TransactionScope.getConnection();
StringBuffer sql = new StringBuffer(400);
sql.append("select jdsi.section_id ");
sql.append("from jtf_dsp_section_items jdsi, ");
sql.append("jtf_dsp_msite_sct_items jdmsi ");
sql.append("where jdsi.inventory_item_id = ? ");
sql.append("and jdsi.section_item_id =
jdmsi.section_item_id ");
sql.append("and jdmsi.mini_site_id = ? ");
sql.append("and nvl(jdsi.start_date_active, sysdate) <=
sysdate ");
sql.append("and nvl(jdsi.end_date_active, sysdate) >=
sysdate ");
sql.append("and nvl(jdmsi.start_date_active, sysdate) <=
sysdate ");
sql.append("and nvl(jdmsi.end_date_active, sysdate) >=
sysdate");
stmt = (OraclePreparedStatement)conn.prepareStatement
(sql.toString());
stmt.setInt(1, itemId);
stmt.setInt(2, minisiteId.intValue());
stmt.defineColumnType(1, Types.INTEGER);
rs = stmt.executeQuery();
if (rs.next())
parentSectionId = rs.getInt(1);
} catch (Exception e1) {
parentSectionId = -1;
IBEUtil.log("ibeCCtdItemDetail.jsp",
"Caught exception while retrieving parent
section id");
IBEUtil.log("ibeCCtdItemDetail.jsp", e1.getMessage());
} finally
try { if (rs != null) rs.close(); } catch (Exception e2) {}
try { if (stmt != null) stmt.close(); } catch (Exception
e2) {}
try {
if (conn != null) TransactionScope.releaseConnection
(conn);
} catch (Exception e2) {}
return parentSectionId;
%>
<%-- end declaration --%>
<%@include file="ibeCCtpSetItem.jsp"%>
<%
The compile-time inclusion of ibeCCtpSetItem.jsp will declare
and set
the following variables:
boolean bItemLoaded - whether section was
loaded
Item lItem - Item
boolean bItemCanBeOrdered - whether item can be
ordered
String[] uomCodes - Item's UOM Codes
Vector itemSellPriceDisplayVec - vector containing
item's selling
prices in formatted
strings
Vector itemListPriceDisplayVec - vector containing
item's list
prices in formatted
strings
int nPriceDefined - number of prices
defined for the item
Perform the following actions:
Set "itemIds" in the PageContext.REQUEST_SCOPE
Set "item" in PageContext.REQUEST_SCOPE
Set "section" in PageContext.REQUEST_SCOPE
MessageManagerInter lMsgMgr =
Architecture.getMessageManagerInstance();
pageContext.setAttribute("_pageTitle",
lMsgMgr.getMessage
("IBE_PRMT_CT_PRODUCT_DETAILS"),
PageContext.REQUEST_SCOPE);
%>
<%@ include file="ibeCCtpPostingI.jsp" %>
<%@ include file="ibeCZzdTop.jsp" %>
<%@ include file="ibeCZzdMenu.jsp" %>
<%
if (bItemLoaded)
OneClick lOneClickObj;
String xprTagArea = "", confirmXpr = "";
String lBuyRoutePage;
String lSectionPathPage = "";
int sectid = 0;
Item[] services = new Item[0];
Item[] relItems = new Item[0];
Item[] complimentary = new Item[0];
ItemFlexfield[] itemFlexfields = new ItemFlexfield[0];
String lItemImage = "", lItemAddtlInfoFile = "";
StringBuffer lRef = new StringBuffer("ibeCCtdItemDetail.jsp?
item=");
String qty = "", userSelUOM = "";
String errorMsg = "";
//--------------- load express checkout preferences ---------
if (IBEUtil.useFeature("IBE_USE_ONE_CLICK"))
xprTagArea = DisplayManager.getTemplate
("STORE_XPR_TAG_AREA").getFileName();
if (xprTagArea == null)
xprTagArea = "";
confirmXpr = lMsgMgr.getMessage("IBE_PRMT_EXPR_CONFIRM");
if (RequestCtx.userIsLoggedIn()) {
//initialize OneClick if user is logged in
BigDecimal partyId = RequestCtx.getPartyId();
BigDecimal accountId = RequestCtx.getAccountId();
lOneClickObj = new OneClick();
lOneClickObj.loadSettingsFrDB(partyId, accountId);
} // end user express checkout
//------------ set "section", lSectionPathPage --------------
String lSectionId = IBEUtil.nonNull(request.getParameter
("section"));
if (lSectionId.equals(""))
lSectionId =
IBEUtil.nonNull((String)pageContext.getAttribute
("section", PageContext.REQUEST_SCOPE));
if(IBEUtil.useFeature("IBE_USE_SECTION_PATH"))
lSectionPathPage = DisplayManager.getTemplate
("STORE_CTLG_SCT_PATH").getFileName();
try {
sectid = Integer.parseInt(lSectionId);
pageContext.setAttribute("section", String.valueOf
(sectid), PageContext.REQUEST_SCOPE);
} catch (NumberFormatException e) { }
if(lSectionPathPage == null)
lSectionPathPage = "";
lBuyRoutePage = DisplayManager.getTemplate
("STORE_CTLG_BUY_PROCESS_ROUTE").getFileName();
/* if error and forwarded back to this page, get values
selected by user */
qty = IBEUtil.nonNull((String)pageContext.getAttribute
("qty", PageContext.REQUEST_SCOPE));
if (qty.equals(""))
qty = "1";
userSelUOM = IBEUtil.nonNull((String)pageContext.getAttribute
("uom", PageContext.REQUEST_SCOPE));
errorMsg = IBEUtil.nonNull((String) pageContext.getAttribute
("errorMsg", PageContext.REQUEST_SCOPE));
//set ref for returning to this page in case of error
lRef.append(lItem.getItemID());
if (sectid > 0)
lRef.append("§ion=");
lRef.append(sectid);
/* Get Bin Open and Bin Close Images */
String binOpenImg = "", binCloseImg = "";
try {
Media binOpenMedia = DisplayManager.getMedia
("STORE_BIN_OPEN_IMAGE", true);
if (binOpenMedia != null)
binOpenImg = binOpenMedia.getFileName();
} catch (MediaNotFoundException mnfe) {}
if (binOpenImg == null)
binOpenImg = "";
try {
Media binCloseMedia = DisplayManager.getMedia
("STORE_BIN_CLOSE_IMAGE", true);
if (binCloseMedia != null)
binCloseImg = binCloseMedia.getFileName();
} catch (MediaNotFoundException mnfe) {}
if (binCloseImg == null)
binCloseImg = "";
/* Get images, additional info, flexfields, related items,
service items */
lItemImage = lItem.getMediaFileName
("STORE_PRODUCT_LARGE_IMAGE");
lItemAddtlInfoFile = lItem.getMediaFileName
("STORE_PRODUCT_ADDTL_INFO");
// check for defaulting
String defaultFromSection = "Y";
if ("Y".equals(defaultFromSection))
if (lItemImage == null || lItemAddtlInfoFile == null)
try {
int parentSectionId = getParentSectionId
(lItem.getItemID());
Section parentSection = Section.load(parentSectionId);
if (lItemImage == null)
lItemImage = parentSection.getMediaFileName
("STORE_SECTION_SMALL_IMAGE");
if (lItemAddtlInfoFile == null)
lItemAddtlInfoFile = parentSection.getMediaFileName
("STORE_SECTION_ADDTL_INFO");
} catch (Exception e) {}
itemFlexfields = lItem.getFlexfields();
try {
services = lItem.getRelatedItems("SERVICE");
} catch (ItemNotFoundException e) {}
try {
relItems = lItem.getRelatedItems("RELATED");
} catch (ItemNotFoundException e) {}
try {
complimentary = lItem.getRelatedItems("COMPLIMENTARY");
} catch (ItemNotFoundException e) {}
%>
<!-- body section -----------------------------------------------
------------->
<table border="0" width="100%">
<%
if (IBEUtil.showPosting()) {
%>
<!--------- iMarketing integration ----------------->
<tr><td colspan="4" align="center">
<% try {
%>
<jsp:include page="ibapstng.jsp" flush="true" />
<% } catch (Throwable e) {
IBEUtil.log("ibeCCtdItemDetail.jsp", "iMarketing error",
Logger.ERROR);
%>
</td></tr>
<% } //end iMarketing installed
%>
<tr><td> </td>
<%
if(!lSectionPathPage.equals(""))
%>
<td colspan="4" class="smallLink">
<jsp:include page="<%=lSectionPathPage%>" flush="true" />
</td>
<% }
%>
</tr>
<tr><td valign="top"> </td>
<!-- center column ------------------------------------------
------------->
<td valign="top" width="70%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="3">
<span class="pageTitle"><%=lItem.getDescription()%
</span></td></tr>
<tr>
<% if (lItemImage != null) {
%>
<td valign="TOP"><img src="<%=lItemImage%>"></td>
<td valign="TOP" colspan="2"><%
=lItem.getLongDescription()%></td>
<% } else {
%>
<td valign="TOP" colspan="3"><%
=lItem.getLongDescription()%></td>
<% }
%>
</tr>
<% if (lItemAddtlInfoFile != null) {
%>
<tr><td colspan="3"><br>
<jsp:include page="<%=lItemAddtlInfoFile%>"
flush="true" />
</td></tr>
<% }
%>
<tr><td colspan="3"><br></td></tr>
<%
for (int i=0; i < itemFlexfields.length; i++)
String prompt = itemFlexfields.getPrompt();
String value = itemFlexfields[i].getValue();
if (value != null && !value.equals(""))
%>
<tr>
<td align="LEFT" width="20%">
<span class="sectionHeader2"><%=prompt%
</span></td>
<td align="LEFT" colspan="2" width="80%"><%=value%
</td></tr>
<% }
if (services.length > 0)
%>
<tr><td colspan="3"><br></td></tr>
<tr><td align="RIGHT" class="sectionHeader1" width="20%">
<%=lMsgMgr.getMessage("IBE_PRMT_CT_WARRANTIES")%>
</td>
<td colspan="2" align="left" class="sectionHeaderBlack"
width="80%"><hr>
</td></tr>
<%
for(int i=0; i < services.length; i++)
%>
<tr>
<td valign="TOP" class="sectionHeaderBlack"
width="20%"> </td>
<td align="left" colspan="2" valign="TOP" width="80%">
<span class="sectionHeaderBlack">
<A HREF="<%= DisplayManager.getURL
(STORE_CTLG_ITM_ROUTE", "item=" + services[i.getItemID()) %>">
<%=services.getDescription()%></A>
</span>
<%=services[i].getLongDescription()%>
</td>
</tr>
<tr>
<td colspan="3" class="sectionHeaderBlack"> </td>
</tr>
<% } //end loop through services
} // end if services.length > 0
if (relItems.length > 0) {
%>
<tr><td colspan="3"><br></td></tr>
<tr>
<td align="RIGHT" class="sectionHeader1" width="20%">
<%=lMsgMgr.getMessage("IBE_PRMT_CT_REL_PRODUCTS")%>
</td>
<td align="left" colspan="2" class="sectionHeaderBlack"
width="80%"><hr></td>
</tr>
<%
for(int i=0; i < relItems.length; i++)
%>
<tr>
<td valign="TOP" class="sectionHeaderBlack"
width="20%"> </td>
<td colspan="2" align="left" valign="TOP"
width="80%">
<span class="sectionHeaderBlack">
<A HREF="<%= DisplayManager.getURL
("STORE_CTLG_ITM_ROUTE", "item=" + relItems[i].getItemID()) %>">
<%=relItems[i].getDescription()%></A>
</span>
<%=relItems[i].getLongDescription()%>
</td>
</tr>
<tr>
<td colspan="3" align="RIGHT"
class="sectionHeaderBlack"> </td>
</tr>
<% } // end loop through related items
} // end if relItems.length > 0
%>
</table>
</td>
<%if (complimentary.length > 0) {
%>
<tr><td colspan="3"><br></td></tr>
<tr>
<td align="RIGHT" class="sectionHeader1" width="20%">
<%=lMsgMgr.getMessage("IBE_PRMT_CT_REL_PRODUCTS")%>
</td>
<td align="left" colspan="2" class="sectionHeaderBlack"
width="80%"><hr></td>
</tr>
<%
for(int i=0; i < complimentary.length; i++)
%>
<tr>
<td valign="TOP" class="sectionHeaderBlack"
width="20%"> </td>
<td colspan="2" align="left" valign="TOP"
width="80%">
<span class="sectionHeaderBlack">
<A HREF="<%= DisplayManager.getURL
("STORE_CTLG_ITM_ROUTE", "item=" + complimentary[i].getItemID())
%>">
<%=complimentary[i].getDescription()%></A>
</span>
<%=complimentary[i].getLongDescription()%>
</td>
</tr>
<tr>
<td colspan="3" align="RIGHT"
class="sectionHeaderBlack"> </td>
</tr>
<% } // end loop through related items
} // end if complimentary.length > 0
%>
</table>
</td>
<!-- right column -------------------------------------------
------------->
<td valign="top" width="20%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<% if (! binOpenImg.equals("")) {
%>
<td><img src="<%=binOpenImg%>"></td>
<% }
%>
<td nowrap class="binHeaderCell" width="100%">
<%
if (!lItem.isConfigurable()) {
%>
<%=lMsgMgr.getMessage("IBE_PRMT_CT_2_WAYS_TO_SHOP")%>
<% } else {
%>
<%=lMsgMgr.getMessage("IBE_PRMT_CT_CONFIG_PRODUCT")%>
<% }
%>
</td>
<% if (! binCloseImg.equals("")) {
%>
<td><img src="<%=binCloseImg%>"></td>
<% }
%>
</tr>
</table>
</td></tr>
<tr><td class="binColumnHeaderCell">
<table border="0" cellspacing="1" width="100%">
<tr><td class="binContentCell" align="CENTER">
<% /////////////////////////////// error
messages //////////////////////////////
if (!errorMsg.equals("")) {
%>
<table><tr><td align="center" class="errorMessage">
<%=errorMsg%>
</td></tr></table>
<% }
/////////////////////////////// display
form //////////////////////////////////%>
<!--Javascript for express checkout confirmation-->
<script language="JavaScript">
function get_confirmation(form)
if (confirm("<%=confirmXpr%>" ) ) {
form.tmpx.name = '1-Click.x';
form.tmpy.name = '1-Click.y';
form.submit();
return true;
else
return false;
</script>
<form method=POST action="<%=lBuyRoutePage%>">
<input type=hidden name="type" value="single">
<input type=hidden name="item" value="<%=lItem.getItemID()%
"><input type=hidden name="refpage" value="<%=lRef.toString
()%>">
<INPUT TYPE="HIDDEN" NAME="tmpx" VALUE="100">
<INPUT TYPE="HIDDEN" NAME="tmpy" VALUE="100">
<%= RequestCtx.getSessionInfoAsHiddenParam() %>
<%
if ( ! lItem.isConfigurable())
{ // display prices
%>
<table>
<tr><td align ="left" nowrap>
<span class="sectionHeaderBlack">
<%=lMsgMgr.getMessage("IBE_PRMT_CT_LIST_PRICE_COLON")%>
</span>
</td>
<%
for (int i=0; i < uomCodes.length && i <
itemListPriceDisplayVec.size(); i++)
if (uomCodes[i] != null && uomCodes[i].equals
(lItem.getPrimaryUOMCode()))
if (itemListPriceDisplayVec.elementAt(i) != null &&
!itemListPriceDisplayVec.elementAt(i).equals(""))
%>
<td align="right">
<%=itemListPriceDisplayVec.elementAt(i)%
<%=lItem.getPrimaryUOM()%></td>
<% } else {
%>
<td> </td>
<% }
break;
} // end primary uomcode
} // end loop through uoms and list price
%>
</tr>
<tr><td align="left" nowrap>
<span class="sectionHeaderBlack">
<%=lMsgMgr.getMessage("IBE_PRMT_CT_YOUR_PRICE_COLON")%>
</span>
</td>
<td>
<% // display selling price for each uom
if (nPriceDefined > 1) {
//prices defined for multiple UOMs for the item
%>
<select name = "uom">
<%
//--------- loop through uoms and prices ------------------
for (int i=0; i < itemSellPriceDisplayVec.size() && i <
uomCodes.length; i++)
if (itemSellPriceDisplayVec.elementAt(i) != null &&
!itemSellPriceDisplayVec.elementAt(i).equals(""))
boolean bSelectUom = false;
if (uomCodes[i] != null && uomCodes[i].equals
(lItem.getPrimaryUOMCode()))
bSelectUom = true;
if (bSelectUom)
%>
<option value="<%=uomCodes[i]%>" SELECTED>
<% } else {
%>
<option value="<%=uomCodes[i]%>">
<% }
%>
<%=itemSellPriceDisplayVec.elementAt(i)%
<%=IBEUtil.nonNull(lItem.getUOM(uomCodes))%
<%
} // end current uom has price
} //end loop i through uoms and prices
%>
</select>
<% //end more than 1 UOM with price defined for the item
} else {
if (nPriceDefined == 0) { //multiple UOMs, none with
price defined
%>
<input type=hidden name="uom" value="<%
=lItem.getPrimaryUOMCode()%>">
<% } else { // 1 UOM with price defined
String formatSellPrice = "";
String uomWithPrice = "";
for (int i=0; i < uomCodes.length && i <
itemSellPriceDisplayVec.size(); i++)
if (itemSellPriceDisplayVec.elementAt(i) != null &&
!itemSellPriceDisplayVec.elementAt(i).equals(""))
formatSellPrice = (String)
itemSellPriceDisplayVec.elementAt(i);
uomWithPrice = uomCodes;
break;
%>
<input type=hidden name="uom" value="<%=uomWithPrice%>">
<%=formatSellPrice%> <%=IBEUtil.nonNull
(lItem.getUOM(uomWithPrice))%>
<% } //end 1 UOM with price defined
} // end display selling prices
%>
</td></tr></table> <%-- end table for the price --%>
<% } // end non-configurable item
if (bItemCanBeOrdered)
// show quantity and buttons only if item can be ordered
%>
<p><%=lMsgMgr.getMessage("IBE_PRMT_CT_QUANTITY")%>
<input type="TEXT" name="qty" size="3" maxlength="20"
value="<%=qty%>">
</p>
<% if (lItem.isConfigurable()) {
%>
<p>
<input type=hidden name="uom" value="<%
=lItem.getPrimaryUOMCode()%>">
<input type=submit name="Configure.x"
value="<%=lMsgMgr.getMessage("IBE_PRMT_CT_CONFIGURE")%
"></p>
<% } else {
%>
<p>
<input type=submit name="Add to Cart.x"
value="<%=lMsgMgr.getMessage
("IBE_PRMT_ADD_TO_CART_PRMT_G")%>">
</p>
<%
if (!xprTagArea.equals(""))
%>
<p><%=lMsgMgr.getMessage("IBE_PRMT_CT_OR")%></p>
<p><jsp:include page="<%=xprTagArea%>"
flush="true" /></p>
<% }
} // end item can be ordered
%>
<br>
</form>
</td></tr></table> <%-- end table for bin content and
header --%>
</td></tr></table>
<p> </p>
<p> </p>
</td></tr></table> <%-- end page table --%>
<% } // end item loaded
%>
<%@ include file="ibeCZzdBottom.jsp" %>
<!-- ibeCCtdItemDetail.jsp end -->my bad...didnt think anyone was gonna come in ...lol......nothing populates in the second drop down...I was thinking of making a separate page and just pass the parameter in, bu i never used jsp include.....any suggestions on how to get this thing working??
Maybe you are looking for
-
Multiple emails with one itune account
My husband has an iPhone and I both iPod with one itune account. How can we keep out personal settings and information seperate on the cloud?
-
Problems working with QuarkXPress 4.1 on System X
Hi. I'm working with more people in an office with systemX plus system 9 and with QurkXPress 4.1. We're conneted all to a server. I can open and work with the Quark docs and save them in the server, but other people with the same Mac and system can o
-
AGAIN! When I am playing scrabble I want to be able to go to Dictionary and Two Letter words when I am playing the game - these are being blocked much to my aggravation! How do I stop the blocking?
-
SAP Certified Development Associate - ABAP with SAP NetWeaver 7.0
Hi, this is kumar from bangalore. Please let me know where can i get the materials to prepare for the certification exam. Regards, kumar
-
Connection to ECC with SAP Logon Group failing
I'm creating a new system connection to an ECC backend using a logon group (transaction SMLG in ABAP stack). I have created the connection with the wizard as a SAP_R3_LoadBalancing connection and given it the appropriate Group, Logical System Name,