Configuring Exception pages thru servlets for tomcat5

Hi,
I am trying to configure exception pages for servlets. But cannot get it done. I have one servlet ServletMapping.java. I am defining in web.xml, that any error should go to the servlet ErrorDisplay.java, which in turn handles the error. I have written for javax.servlet.ServletException.
But the control does not go to the error page servlet ErrorDisplay.java
thanx in advance
-biyat
Here is my web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
<web-app>
<display-name>Biyat Testing System for web development</display-name>
<description>
Used to write Jsp/ Servlets
</description>
<servlet>
<servlet-name>ServletMapping</servlet-name>
<servlet-class>code.ServletMapping</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServletMapping</servlet-name>
<url-pattern>/code/ServletMapping</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>ErrorDisplay</servlet-name>
<servlet-class>code.ErrorDisplay</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ErrorDisplay</servlet-name>
<url-pattern>/code/ErrorDisplay</url-pattern>
</servlet-mapping>
<error-page>
<exception-type>javax.servlet.ServletException</exception-type>
<location>/code/ErrorDisplay</location>
</error-page>
</web-app>
Here is my servlets
in webexp/WEB-INF/classes
code/ErrorDisplay.java
package code;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class ErrorDisplay extends HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String code=null, message=null, type=null;
Object codeObj, messageObj, typeObj;
codeObj = request.getAttribute("javax.servlet.error.status_code");
messageObj = request.getAttribute("javax.servlet.error.message");
typeObj = request.getAttribute("javax.servlet.error.exception_type");
if(codeObj != null)
code = codeObj.toString();
if(messageObj!=null)
message = messageObj.toString();
if(typeObj != null)
type = typeObj.toString();
String reason = (code!=null ? code : type);
out.println("<html>");
out.println("<head><title>"+reason+":- "+message+"</title></head>");
out.println("<body>");
out.println("<h1>"+reason+"</h1>");
out.println("<h1>"+message+"</h1>");
out.println("<hr>");
out.println("<i>Error accessing "+request.getRequestURI()+"</i>");
out.println("</body></html>");
Here is the page where there is error.
in webexp/WEB-INF/classes
code/ServletMapping.java
package code;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class ServletMapping extends HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
String var1 = "logging starts";
String str = request.getParameter("hello");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
FileInputStream fis = new FileInputStream("hello.gif");
out.println("<html><body><font color=red><b>Hello Biyat</b></font></body></html>");

Hi, Biyat,
The first thing I can see would help is to also define an error page for java.io.IOException - you can even re-use the same error page by adding the following to web.xml:
<error-page>
<exception-type>java.io.IOException</exception-type>
<location>/code/ErrorDisplay</location>
</error-page>
djiao

Similar Messages

  • Can I use XSQL pages & XSQL Servlet for oracle 7.3 ?

    Can I use XSQL pages & XSQL Servlet
    for oracle 7.3 or not?,if it is possible
    please give me reply.
    Thanks.
    Ramesh Nallapu.

    Can I use XSQL pages & XSQL Servlet
    for oracle 7.3 or not?,if it is possible
    please give me reply.
    Thanks.
    Ramesh Nallapu.
    null

  • InstallBase-No configuration is build for Configured Items procured thru PO

    No configuration is build in Install base for Configured Items procured thru PO.
    Problem Description:
    We created a PO for a Configured Item and received into an Org ( setup as serialized at receipt) for stocking purpose. The Entire Configuration is not created in Install base. We expected both the Parent and the child ( which are IB-trackable) to be created in the Install base. But the child is not created in the Install base.
    We set the profile CSI:Explode BOM as "yes" and still it did not help.
    Any ideas . ( Note : this is a duplicate post. I have posted under Procurement forums as well).
    Regards
    Kumar

    <u><i><b>Steps for SD Variant Configuration</b></i></u>
    Some light on Variant Configuration in Detail.
    The procedure is as follows:
    1. Create a Material - KMAT type with Item category (002)
    2. Create Charateristics in CT04 - Zbike, where in values mention the Color of the bile like Red, Blue etc
    3. Create another characteristics in CT04 - ZPrice, where directly go the additional data tab and maintain the table SDCOM and field VKOND (ABAP Dictionary it will ask for)
    4. Assign these two characteristics to a Class in CL01 - ZBikeclass ( Type 300) in characteristics tab page.
    5. Then go to CU41 Configuration profile select the material and enter the description click on the class assignment ie assign Zbikclass.
    Now go back to CT04 - enter Zbike -go to values- select Red- go to extras - Other Dependencies - Select Procedure enter in front 10 write - $self.ZPrice='Red' and save
    6. Now go back go to extras - Other Dependencies - assignments and assign relationship ( by default it will come just save)
    7. Now select Blue- go to extras - Other Dependencies - Editor - Select Procedure enter in front of 10 write - $self.ZPrice='Blue' and save
    8. Now go back go to extras - Other Dependencies - assignments and assign relationship ( by default it will come just save)
    9. Now go to VK11 - Enter VA00 (Condition)(For Std RVA001 Pricing Procedure) - enter variant Red and Blue give the rates accordingly and create the sales order.
    Reward if it helps
    Regards,
    Anbu

  • HELP PLS -exception in deploy transformation for "0ANALYSIS_PATTERN"

    Hi All,
    I have a serious problem here. Please help me here...thanks
    We have recently upgraded our BI 7.0 system from BI ABAP - 10 to
    Support Package Stack - 16, which includes BI ABAP - 18 and BI JAVA -
    16. After the upgrade we are facing problems running any query on the
    portal. We get the same consistent error throughout. The portal error
    message is enclosed. I tried installing 0Analysis_Pattern many times
    but it didn't work.
    Secondly when that didn't work I tried running RSPOR_SETUP, in step 2 I
    get the error message, Different ABAP and JAVA support package.
    SAP came back with a reply saying to do BI JAVA config using template installer. We did that, all looks fine. We also ran the Netweaver Diagnostic tool and all looks fine there as well except the ADS is not configured( I doubt this error is anything to do with ADS as we are not using abode export)
    We went through all these notes, 917950, 937697 and 983156 for the configuration.
    But again when we run the RSPOR_SETUP we get the same error message: Different ABAP and JAVA support package
    Also I ran queries using RSRT ....when I execute using the ABAP Web works fine but opens in port 8000, but when I execute using JAVA web it throws the same error message again as below using port 50000. Also I get the same error message when I open 0ANALYSIS_PATTERN using WAD and try to execute it.
    Has anyone faced this problem before?
    Error message below
    500 Internal Server Error
      BEx Web Application
    To avoid this exception see the steps below. To help SAP better investigate this issue, you will need to provide the diagnostic information from these steps.
    1. Most likely, the issue you are experiencing has already been corrected. Please make sure that the most recent patch level is deployed on your system according to notes 1033246 and 1011241. Starting with Support Package Stack 16 patch level 30, BI Java is delivered according to the synchronized delivery process described in the note 1033246.
    2. Please ensure that NetWeaver Business Intelligence Diagnostics & Support Desktop Tool  does not report any issues on your server according to note 937697. You can start it by clicking here (administrator permissions are required).
    3. When opening any customer message on this issue, please attach:
    Support Desktop Tool support info ZIP  file according to note 937697,
    Required information for reproduction  according to note 948490.
    Error Summary
    Exception occured while processing the current request; this exception cannot be handled by the application or framework
    If the information on this page does not help you locate and correct the cause of the problem, contact your system administrator
    To facilitate analysis of the problem, keep a copy of this error page Hint: Most Web browsers allow you to select all content, and copy and paste it into an empty document (such as in an email or simple text file)
    Root Cause
    The initial exception that caused the request to fail was:
    General exception in deploy transformation for object "0ANALYSIS_PATTERN"
    com.sap.ip.bi.base.exception.BIBaseRuntimeException: General exception in deploy transformation for object "0ANALYSIS_PATTERN"
    at com.sap.ip.bi.deploytime.BISP2Jsp.convert(BISP2Jsp.java:555)
    at com.sap.ip.bi.webapplications.runtime.jsp.portal.service.template.PortalTemplateAccessService.getTemplateContent(PortalTemplateAccessService.java:90)
    at com.sap.ip.bi.webapplications.runtime.preprocessor.Preprocessor.parseTemplate(Preprocessor.java:163)
    at com.sap.ip.bi.webapplications.runtime.xml.XmlTemplateAssembler.doInit(XmlTemplateAssembler.java:79)
    at com.sap.ip.bi.webapplications.runtime.template.TemplateAssembler.init(TemplateAssembler.java:128)
    Log ID 0017A4AB12A7006B00000395000016180004605B78DEE173
    Details: Full Exception Chain
    System Environment
    Server
    BI Java Release: 7 - Patch level: 0000000016 - Description: BI Web Applications Java - Additional info:  - Production mode: true
    BI ABAP Release: 700 - Patch level: 0018 - Description: SAP NetWeaver BI 7.0 (GBDCLNT100) - Additional info:  - Production mode: true
    Java Virtual Machine Java HotSpot(TM) 64-Bit Server VM - Sun Microsystems Inc. - 1.4.2_15-b02
    Operating System Windows 2003 - ia64 - 5.2
    Context
    ACCESSIBLE false
    CACHE true
    CONTENT_PADDING true
    COUNTRY 
    DEBUG false
    DEBUG_LEVEL 0
    DEBUG_MESSAGES false
    DEBUG_TEXTS false
    DEFAULT_FONT 
    DISPLAY_STACK_TRACE_IN_ERROR_PAGES true
    LANGUAGE en
    Master System Alias GBDCLNT100
    NAVIGATION_NODE_ACTIVE_IVIEW pcd:portal_content/com.sap.pct/platform_add_ons/com.sap.ip.bi/iViews/com.sap.ip.bi.bex
    PROFILING false
    Query String (Initial Browser Request) QUERY=TEST30
    RTL false
    Request URL
    SAP_BW_IVIEW_ID pcd:portal_content/com.sap.pct/platform_add_ons/com.sap.ip.bi/iViews/com.sap.ip.bi.bex
    SERVER_URL_PREFIX
    THEME_NAME sap_tradeshow
    TRACE false
    TRAY_TYPE PLAIN
    Time Tue Jan 13 11:24:52 GMT 2009
    USE_HTTPS_FOR_ADS false
    USE_SAP_EXPORT_LIB false
    User SERCOWNKN (USER.R3_DATASOURCE.SERCOWNKN)
    VALIDATION_DATA false
    Deployed SCAs
    SCA Version SP Patch Compiled Deployed
    ADSSAP 7.00 16 0 2008-06-10 11:48:09 BST 2008-12-29 12:21:02 GMT
    BASETABLES 7.00 16 0 2008-06-10 12:02:26 BST 2008-12-29 12:02:50 GMT
    BI-BASE-S 7.00 17 23 2008-12-24 10:27:08 GMT 2009-01-07 11:53:24 GMT
    BI-IBC 7.00 16 0 2008-06-10 17:29:06 BST 2008-12-29 12:45:13 GMT
    BI-REPPLAN 7.00 16 0 2008-06-10 18:46:18 BST 2008-12-29 12:59:08 GMT
    BI-WDALV 7.00 16 0 2008-06-10 18:46:28 BST 2008-12-29 12:57:58 GMT
    BIWEBAPP 7.00 17 23 2008-12-24 10:27:42 GMT 2009-01-07 11:52:59 GMT
    BI_MMR 7.00 16 0 2008-06-10 12:03:07 BST 2008-12-29 12:21:38 GMT
    BI_UDI 7.00 16 0 2008-06-10 12:03:25 BST 2008-12-29 12:30:20 GMT
    CAF 7.00 16 0 2008-06-10 19:14:45 BST 2008-12-29 12:34:53 GMT
    CAF-KM 7.00 16 0 2008-06-10 18:52:06 BST 2008-12-29 13:12:43 GMT
    CAF-UM 7.00 16 0 2008-06-10 19:14:53 BST 2008-12-29 12:22:26 GMT
    CORE-TOOLS 7.00 16 0 2008-06-10 12:06:18 BST 2008-12-29 12:03:19 GMT
    EP-PSERV 7.00 16 0 2008-06-10 17:37:42 BST 2008-12-29 13:00:07 GMT
    EP-WDC 7.00 16 0 2008-06-10 15:20:00 BST 2008-12-29 13:01:10 GMT
    EPBC 7.00 16 0 2008-06-10 17:36:02 BST 2008-12-29 12:23:03 GMT
    EPBC2 7.00 16 0 2008-06-10 17:36:14 BST 2008-12-29 13:01:15 GMT
    EP_BUILDT 7.00 10 0 2006-10-24 18:44:00 BST 2007-10-03 17:16:57 BST
    JLOGVIEW 7.00 16 0 2008-06-10 11:07:00 BST 2008-12-29 12:03:55 GMT
    JSPM 7.00 16 0 2008-06-10 11:07:00 BST 2008-12-19 11:42:33 GMT
    KM-KW_JIKS 7.00 16 0 2008-06-10 12:09:28 BST 2008-12-29 12:23:19 GMT
    KMC-BC 7.00 16 0 2008-06-10 17:38:03 BST 2008-12-29 13:02:33 GMT
    KMC-CM 7.00 16 0 2008-06-10 17:38:59 BST 2008-12-29 13:03:37 GMT
    KMC-COLL 7.00 16 0 2008-06-10 17:39:23 BST 2008-12-29 13:04:00 GMT
    LM-PORTAL 7.00 16 0 2008-06-10 18:55:57 BST 2008-12-29 13:04:05 GMT
    LM-TOOLS 7.00 16 0 2008-06-10 19:19:13 BST 2008-12-29 12:40:40 GMT
    NET-PDK 7.00 16 0 2008-06-10 17:39:31 BST 2008-12-29 12:53:38 GMT
    RTC 7.00 16 0 2008-06-10 17:39:47 BST 2008-12-29 12:53:44 GMT
    RTC-STREAM 7.00 16 0 2008-06-10 17:39:48 BST 2008-12-29 12:44:16 GMT
    SAP-EU 7.00 16 0 2008-06-10 18:57:14 BST 2008-12-29 13:11:27 GMT
    SAP-JEE 7.00 16 0 2008-06-10 12:14:29 BST 2008-12-29 12:04:52 GMT
    SAP-JEECOR 7.00 16 0 2008-06-10 12:16:00 BST 2008-12-29 12:08:11 GMT
    SAP_BUILDT 7.00 10 0 2006-10-21 20:06:00 BST 2007-10-03 17:17:12 BST
    SAP_JTECHF 7.00 16 0 2008-06-10 12:17:05 BST 2008-12-29 12:09:31 GMT
    SAP_JTECHS 7.00 16 0 2008-06-10 12:24:43 BST 2008-12-29 12:29:00 GMT
    UMEADMIN 7.00 16 0 2008-06-10 19:27:45 BST 2008-12-29 12:41:03 GMT
    UWLJWF 7.00 16 0 2008-06-10 17:40:28 BST 2008-12-29 13:04:23 GMT
    VCBASE 7.00 16 0 2008-06-10 17:40:33 BST 2008-12-29 13:13:00 GMT
    VCFLEX 7.00 16 0 2008-06-10 17:41:04 BST 2008-12-29 12:55:50 GMT
    VCFRAMEWORK 7.00 16 0 2008-06-10 17:41:13 BST 2008-12-29 12:56:00 GMT
    VCKITBI 7.00 16 0 2008-06-10 17:34:47 BST 2008-12-29 12:44:17 GMT
    VCKITGP 7.00 16 0 2008-06-10 17:41:13 BST 2008-12-29 12:44:20 GMT
    VCKITXX 7.00 16 0 2008-06-10 17:41:13 BST 2008-12-29 12:44:21 GMT
    WDEXTENSIONS 7.00 16 0 2008-06-10 18:58:51 BST 2008-12-29 13:13:18 GMT
    Full Exception Chain
    Log ID 0017A4AB12A7006B00000395000016180004605B78DEE173
    com.sap.ip.bi.base.exception.BIBaseRuntimeException: Error during conversion of the Web template "0ANALYSIS_PATTERN from the master system     at com.sap.ip.bi.webapplications.runtime.jsp.portal.service.template.PortalTemplateAccessService.getTemplateContent(PortalTemplateAccessService.java:95)     at com.sap.ip.bi.webapplications.runtime.preprocessor.Preprocessor.parseTemplate(Preprocessor.java:163)     at com.sap.ip.bi.webapplications.runtime.xml.XmlTemplateAssembler.doInit(XmlTemplateAssembler.java:79)     at com.sap.ip.bi.webapplications.runtime.template.TemplateAssembler.init(TemplateAssembler.java:128)     at com.sap.ip.bi.webapplications.runtime.base.Template.doInit(Template.java:113)     at com.sap.ip.bi.webapplications.runtime.base.PageObject.doInit(PageObject.java:286)     at com.sap.ip.bi.webapplications.runtime.base.PageObject.init(PageObject.java:261)     at com.sap.ip.bi.webapplications.runtime.base.ItemRenderer.init(ItemRenderer.java:39)     at com.sap.ip.bi.webapplications.runtime.impl.Page.initPageObject(Page.java:4995)     at com.sap.ip.bi.webapplications.runtime.impl.Page.createPageObject(Page.java:5342)     at com.sap.ip.bi.webapplications.runtime.impl.Page.setTemplate(Page.java:6537)     at com.sap.ip.bi.webapplications.runtime.impl.Page.doSetTemplateCommand(Page.java:6249)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)     at java.lang.reflect.Method.invoke(Method.java:324)     at com.sap.ip.bi.util.MethodInvoker.callMethod(MethodInvoker.java:101)     at com.sap.ip.bi.webapplications.runtime.command.CommandProcessorHelper.processCommand(CommandProcessorHelper.java:415)     at com.sap.ip.bi.webapplications.runtime.command.CommandProcessorHelper.processCommand(CommandProcessorHelper.java:330)     at com.sap.ip.bi.webapplications.runtime.base.CommunicationProcessor.processCommand(CommunicationProcessor.java:175)     at com.sap.ip.bi.webapplications.runtime.impl.Page.processCommandSuper(Page.java:1821)     at com.sap.ip.bi.webapplications.runtime.impl.Page.processCommandInternal(Page.java:1787)     at com.sap.ip.bi.webapplications.runtime.impl.Page.processCommandSequence(Page.java:2497)     at com.sap.ip.bi.webapplications.runtime.impl.Page.doProcessRequest(Page.java:4018)     at com.sap.ip.bi.webapplications.runtime.impl.Page._processRequest(Page.java:3021)     at com.sap.ip.bi.webapplications.runtime.impl.Page.processRequest(Page.java:2864)     at com.sap.ip.bi.webapplications.runtime.controller.impl.Controller.doProcessRequest(Controller.java:994)     at com.sap.ip.bi.webapplications.runtime.controller.impl.Controller._processRequest(Controller.java:883)     at com.sap.ip.bi.webapplications.runtime.controller.impl.Controller.processRequest(Controller.java:860)     at com.sap.ip.bi.webapplications.runtime.jsp.portal.services.BIRuntimeService._handleRequest(BIRuntimeService.java:362)     at com.sap.ip.bi.webapplications.runtime.jsp.portal.services.BIRuntimeService.handleRequest(BIRuntimeService.java:279)     at com.sap.ip.bi.webapplications.runtime.jsp.portal.components.LauncherComponent.doContent(LauncherComponent.java:24)     at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)     at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)     at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)     at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)     at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)     at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)     at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:645)     at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)     at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)     at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)     at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)     at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)     at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:524)     at java.security.AccessController.doPrivileged(Native Method)     at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:407)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)     at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)     at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)     at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)     at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)     at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)     at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)     at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)     at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)     at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)     at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)     at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)     at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)     at java.security.AccessController.doPrivileged(Native Method)     at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)     at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)Caused by: com.sap.ip.bi.base.exception.BIBaseRuntimeException: General exception in deploy transformation for object "0ANALYSIS_PATTERN"     at com.sap.ip.bi.deploytime.BISP2Jsp.convert(BISP2Jsp.java:555)     at com.sap.ip.bi.webapplications.runtime.jsp.portal.service.template.PortalTemplateAccessService.getTemplateContent(PortalTemplateAccessService.java:90)     ... 63 more

    Hi,
    Please help.
    How did you manage to resolve this. I have similar issues.
    I have SAP_ALL and can run the reports without problems but users have error message
    general exception in deploy transformation for object "WEB_TEMPLATE"
    thanks

  • Directing home page to servlet

    We use Netscape 3.6 and iPlanet 4.1 as web servers, and Tomcat 3.3.1 as servlet engine.
    I am writing a servlet for a mobile site that identifies user agent to generate the appropriate mark up language for the device (WML/HDML/HTML and etc).
    I am unable to configure the web server to route the home page to the servlet. (e.g. going to http://mobile.xxx.com would direct to http://mobile.xxx.com/home.xml which home.xml is processed by the servlet engine)
    Any thoughts?
    Thank you in advance.
    Anita Loo

    Anita,
    Have you tried adding home.xml as one of the index filenames under Content Management | Document Preferences?
    See if adding home.xml as the first entry helps in what you're trying to accomplish. What the webserver will do on a request to / is go through the list of files defined in Index filenames and look for the first match. If no match is found, it will either display a directory listing of all files in the document root or respond with an error page depending on what option Directory Indexing is set to.

  • Store html page with servlets

    we know its possible to generate a html page using servlets
    i would like to know using servlets is it possible to create a new html page and store this page in a desired location
    and acess it if its only needed

    Hi friend,
    I am chetan from India, I have developed the WebSite www.bhavishya.net. I am encountering a serious problem in writing into a text file. I am unable to configure the path of the text file. while using Linux i got it. but now i am using Windows Environment. The code is as follows. could u plese give the correct path ("<web-server-root>/httpdocs/file.txt")
    public String ewrite(String str)
    String err = "File updated";
    try
    Date d = new Date();
    BufferedWriter bwout = null;
    // for Web Server
    try
    //BufferedWriter out = new BufferedWriter(new FileWriter("/home/bhavishya/ErrorLog.txt", true)); // For Linux
    bwout = new BufferedWriter(new FileWriter("./bhavishya/logs/ErrorLog.txt", true));
    bwout.write(d.toLocaleString()+" : "+str+"\n");
    catch (RuntimeException e1) {err = e1.toString(); e1.printStackTrace();}
    System.out.println("ErrorLog - 21");
    bwout.close();
    catch (IOException e) { System.out.println(e); }
    return err;
    Regards,

  • Servlet for downloading a file

    i am writing a servlet for downloading a file on a GET action in the form..the web-xml is deployed correctly as far as i can interpret..bt i am encountering an error during the run time..
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    here is the log file..
    Jul 11, 2008 12:07:14 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet DwnFile threw exception
    java.lang.NullPointerException
         at com.example.web.dwnfile.doGet(dwnfile.java:17)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    it has some more content bt it is just the exceptions thrwn...
    and here is my *.java file*
    package com.example.web;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class dwnfile extends HttpServlet
    public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException
    response.setContentType("/image/jpeg");
    ServletContext ctx=getServletContext();
    InputStream is=ctx.getResourceAsStream("/2004.jpeg");
    int read=0;
    byte[] bytes=new byte[1024];
    OutputStream os=response.getOutputStream();
    while ((read=is.read(bytes))!=-1)
    {os.write(bytes,0,read);
    os.flush();
    os.close();
    the bold line is whre the exception is pointing..i think..
    thanks in advance..
    Edited by: Sun_Rockz on Jul 10, 2008 7:13 PM

    response.setContentType("/image/jpeg");
    ServletContext ctx=getServletContext();
    InputStream is=ctx.getResourceAsStream("/2004.jpeg");there was an error in this part of code..the image extension of .jpeg is not allowed it seems..on changing it to jpg worked..and
    in the first line the contenttype mst not be preceded by a forward slash..
    now one more doubt relating to the same servlet..
    response.setContentType("application/x-zip");
    ServletContext ctx=getServletContext();
    InputStream is=ctx.getResourceAsStream("/servlet_spec.zip");
    if i keep this in my servlet the required action is taking place..i.e.i am gettin a download option bt the problem is tht the file is getting downloaded as a download.do file.....
    download.do is the url pattern tht i am using in my html web page..
    i tried replacing different types of allplications and files bt all are downloaded wit the same name. i.e. download.do
    so what do u think is reason behind this..
    thanks for all the replies.
    Edited by: Sun_Rockz on Jul 11, 2008 10:47 AM
    Edited by: Sun_Rockz on Jul 11, 2008 10:51 AM

  • Retrieve values from a table of a JSP page in Servlet.

    Hello all,
    I am new in JSP servlet world, I want to create a grid on JSP page using Servlet.
    Suppose i have some records in a JSP page and This JSP page will display these records in a tabular form. And, on a button click that table data should be
    accessible in servlet,
    Now, How can i traverse among all the rows of that table of JSP page in servlet. or How can i retrieve a specific cell record of that table of JSP page in servlet.
    Can anyone please answer this.
    Thank you and regards.

    Hi,
    Create in your HTML form inputs with the same name i.e.:
    <input name="a[]" value="2" >
    <input name="a[]" value="9" >
    In your jsp page use :
    String Values[] = request.getParameterValues("a[]") ;
    This will give you a string array of two elements.
    for (int x = 0; x < Values.length; x++)
        System.out.println(Values[x]) ;
    }Will print :
    2
    9
    Hope this helps.
    Bill Moo

  • Urgent....How can i redirect to my jsp page from servlet in init() method..

    How can i redirect to my jsp page from servlet in init() method..Becoz that servlet is calling while server startsup..so im writing some piece of code in init() method..after that i want to redirect to some jsp page ...is it possible?
    using RequestDispatcher..its not possible..becoz
    RequestDispatcher rd = sc.getRequestDispatcher("goto.jsp");
    rd.foward(req,res);
    Here the request and response are null objects..
    So mi question can frame as how can i get request/response in servlet's init method()..

    Hi guys
    did any one get a solution for this issue. calling a jsp in the startup of the servlet, i mean in the startup servlet. I do have a same req like i need to call a JSP which does some data reterival and calculations and i am putting the results in the cache. so in the jsp there in no output of HTML. when i use the URLConnection i am getting a error as below.
    java.net.SocketException: Unexpected end of file from server
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:707)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:705)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:519)
    at com.toysrus.fns.alphablox.Startup.callJSP(Unknown Source)
    at com.toysrus.fns.alphablox.Startup.init(Unknown Source)
    at org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
    so plz do let me know how to call a jsp in the start up of a servlet.
    Thanks
    Vidya

  • How to hide preview configurator summary page when launching configurator from iStore

    Hi,
    We have a requirement to hide preview configuration summary page in iStore whereas it should be visible when launching from other host applications.We tried doing it with help of usage functionality as below.
    1) Create a usage with some name say “iStore” in configurator.
    2) Take copy of summary with Status region template and add display condition to hide the summary region.
    3) Take copy of the model active ui and attach the above template to it.
    4) Publish the model with this new copy UI and usage as iStore to the host application.(There will be 2 publications one with this usage and other with normal)
    5) Enable the profile CZ:Publication usage at application/responsibility levels for iStore.
    With the above approach users are concerned that we need to maintain 2 User Interfaces in Configurator and each time any change has to be done both the user interfaces needs to be changes which will not be a feasible option in case of complex models.We would like to know if there is any other approach to hide this summary page from istore.
    We are on R12.1.3 and are using fusion configurator engine.
    Any suggestions on customizations/approach will be appreciated.

    Create a Dynamic Action:
    When
    Event: Page Load
    Condition: -No Condition -
    True Actions
    Action: Hide
    Selection Type: jQuery Selector
    Affected Elements: #t20PageHeader
    Condition
    Condition Type: Request = Expression 1
    Expression 1: CRM

  • How can I display the HTML page from servlet which is called by an applet

    How can I display the HTML page from servlet which is called by an
    applet using the doPost method. If I print the response i can able to see the html document. How I can display it in the browser.
    I am calling my struts action class from the applet. I want to show the response in the same browser.
    Code samples will be appreciated.

    hi
    I got one way for this .
    call a javascript in showDocument() to submit the form

  • Problem with Configurator - Cannot Update Item Attributes for a Config item

    Hi!
    We configured an item to reproduce the following feature of Oracle Configurator in our business case (Oracle Configurator Modeling Guide - 115czmod.pdf): «For example, if you have raw materials that are ordered by lengths, do not create an item for each length. Instead, define a single item for each raw material with an attribute: Length. Then capture the needed length from the end user by a numeric input or from a List of Options, and associate that input with the attribute.»
    However, after we run the AutoCreate Configuration Items program the item was created in the Item Master but no Attribute was updated with the user defined values (within OConfigurator).
    We associated Item Attributes to Propoerties and these are associated to Feature Options.
    we wish to have the Item Descriptive Element Values (Item Catalog)
    transferred from the Configurator run time, after we configure any item.
    This is because we are working with item dimensions, such as length and width.
    We need to define these dimensions during the Configurator run time and have them transferred into the final configuration so that we can use them later on manufacturing. We wish to display these dimensions on a job.
    Support said that "The descriptive element value for the configuration item is copied from the model. This process will not look at the properties in the configurator.
    You may consider using the custom hook for catalog descriptions to get the selected attributes from CZ to the descriptive elements for the config item. Please see Custom CTO Packages under Setup page 2-63 in CTO Process Guide for more details."
    I'm trying to implement the suggested solution.
    I've customized user_catalog_desc procedure on CTO_CUSTOM_CATALOG_DESC package to populate the item catalog values.
    I'm failing to find the descriptive element values defined on configuratior for a specific inventory item id.
    I have managed to found a relation between "p_params.p_item_id" given in procedure user_catalog_desc and
    the configurated item_id in order to update the catalog data on the CTO_CUSTOM_CATALOG_DESC package.
    This is what I've done:
    procedure user_catalog_desc (
    p_params IN CTO_CUSTOM_CATALOG_DESC.inparams,
    p_catalog_dtls IN OUT NOCOPY CTO_CUSTOM_CATALOG_DESC.catalog_dtls_tbl_type,
    x_return_status OUT NOCOPY VARCHAR2)
    is
    begin
    declare
    counter number;
    i number;
    l_value varchar2(30);
    begin
    -- Put your logic here in such a way that you populate p_catalog_dtls
    -- parameter. p_catalog_dtls is a array of records. The attributes of
    -- this record are cat_element_name and cat_element_value.
    -- viz. record (
    -- cat_element_name varchar2(30),
    -- cat_element_value varchar2(30)
    -- Example : p_catalog_dtls(1).cat_element_value := 'XYZ';
    -- IMPORTANT : DO NOT ALTER THE VALUE OF cat_element_name . Doing so will
    -- result in incorrect or inconsistent behaviour.
    -- Make sure you set the x_return_status variable to one of the following:
    -- FND_API.G_RET_STS_SUCCESS to indicate success
    -- FND_API.FND_API.G_RET_STS_ERROR to indicate failure with expected status
    -- FND_API.FND_API.G_RET_STS_UNEXP_ERROR to indicate failure with unexpected status
    select count(*) into counter from MTL_DESCR_ELEMENT_VALUES
    where inventory_item_id = p_params.p_item_id;
    for i in 1 .. counter loop
    select
    distinct to_char(nvl(cz.input_num_val,cz.item_num_val)) into l_value
    from OE_ORDER_LINES_V oe
    , oe_order_headers_all oeh
    , CZ_CONFIG_CONTENTS_V cz
    where oe.header_id = oeh.header_id
    and oeh.order_number in (
    select distinct oeh.order_number
    from OE_ORDER_LINES_V oe
    , oe_order_headers_v oeh
    where oe.header_id = oeh.header_id
    and oe.inventory_item_id = p_params.p_item_id)
    and cz.ps_node_name = p_catalog_dtls(i).cat_element_name
    and oe.config_header_id = cz.config_hdr_id
    and oe.config_header_id in (select distinct cz.config_hdr_id from CZ_CONFIG_CONTENTS_V cz)
    and cz.ps_node_name in (select element_name from MTL_DESCR_ELEMENT_VALUES where inventory_item_id = p_params.p_item_
    id);
    p_catalog_dtls(i).cat_element_value := l_value;
    end loop;
    x_return_status := FND_API.G_RET_STS_SUCCESS;
    end user_catalog_desc;
    end;
    Although the customization seam correct the AutoCreate Configuration Items process
    terminates with warning, and the catalog info is not updated as expected.
    Can anyone help me on this?
    Many thanks in advance.
    Paulo Santos

    How did you solve this issue? During my testing I found there to be no link to the order lines when I was within this program. Therefore I am having issues getting the configuration information to populate the catalog. Is there a link and I just was doing it wrong? Thanks for any help!
    Thanks,
    Angela

  • XSLT Mapping, Transformer configuration exception occurred when loading

    Hi,
    My source message is an IDOC HRMD, I need my target message to include exactly
    <EPERSON xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ContextPersonMessage">
    I have therefore suggested to use XSLT mapping.
    Here is the test_mapping.xsl that I Imported as Zip in Imported Archives.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://polyright.com/xi/HR">
         <xsl:template match="/">
              <EPERSON xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ContextPersonMessage">
                          <xsl:for-each select="HRMD_A07/IDOC/E1PLOGI">
                <CONTEXTPERSON personid="" id="">
                      <PERSON action="add">
                               <TITLE></TITLE>
                               <FIRSTNAME><xsl:value-of select="E1PITYP/E1P0002/VORNA"/></FIRSTNAME>
                               <SECONDNAME></SECONDNAME>
                               <NAME><xsl:value-of select="E1PITYP/E1P0002/NACHN"/></NAME>
                               <ADDRESS1></ADDRESS1>
                               <ADDRESS2></ADDRESS2>
                               <POSTALCODE></POSTALCODE>
                               <CITY></CITY>
                               <COUNTRY></COUNTRY>
                               <COUNTRYID></COUNTRYID>
                               <PROFESSION></PROFESSION>
                               <LANGUAGE></LANGUAGE>
                               <LANGUAGEID></LANGUAGEID>
                               <PERSONTYPEID></PERSONTYPEID>
                               <CREATIONDATE></CREATIONDATE>
                               <BIRTHDATE></BIRTHDATE>
                               <CATEGORY></CATEGORY>
                             </PERSON>
                      </xsl:for-each>
              </EPERSON>
         </xsl:template>
    </xsl:stylesheet>
    When I test the Interface mapping, I get the following error:
    Transformer configuration exception occurred when loading XSLT test_mapping.xsl (http://polyright.com/xi/HR, 783938d1-4463-11dd-b136-e03ac0a80c15, -1)
    Searching through the forum, it is probably an namespace issue, but I have no idea of what needs to be changed. Any suggestions ?

    Try running end-to-end scenario and check if you could get detailed error message.
    Also check if the problem arises from the "ns0" usage.
    Regards,
    Prateek

  • Inserting Image on a HTML page through servlet

    I want to insert an image on a HTML page which will be generated by a servlet.For that I have written the <IMG SRC>tag.But my doubt is where to store the image(i.e in which directory of the web server) I should store the Image.I am using JavaWebServer2.0.
    please help

    You can put your images in public_html directory.

  • How to get the section value into configurator developer page

    Hi,
    I am working on configurator developer, Can I get the section value into the configurator developer page by any setup. If possible means please help me on that.
    Thanks advance,
    Gopi

    I thought the same.Thanks for confirming...I tried with loop approach.but i am unable to get decimal part...
    eg if my values are 12.25 and 123.12....my below code ignores decimal points..i know since i am using Number, it is happening..but could you please let me know how can i get decimal values also..
    OAViewObject vo = (OAViewObject) am.findViewObject("XXXXInvDistributionsVO1");
    vo.first();
    Number grossamount = 0;
    for (int i=0;i< vo.getRowCount();i++) {
    // BigDecimal grossamount1 = new BigDecimal((vo.getRowAtRangeIndex(i).getAttribute("Amount")));
    grossamount = ((oracle.jbo.domain.Number)vo.getRowAtRangeIndex(i).getAttribute("Amount")).intValue();
    System.out.println("grossamount "+grossamount); // it ignores and prints decimal points
    BigDecimal grossamount1 = new BigDecimal(grossamount.intValue());
    System.out.println("grossamount1 "+grossamount1); // it ignores and prints decimal points
    vo.next();
    Thanks
    Raj

Maybe you are looking for

  • Using getURL to access network files

    I am working on an Intranet site and I need a button in Flash to open a file that's on our network share. I know about the getURL function and use it often to link to HTML files that are on the same server as the web files, but I don't know how to us

  • Calculation in Pivot..

    Hi I have a query.. for calculation of % in pivot, SNo|Sub|Total|Lang1|Lang2|%Lang1|%Lang2 1 |AB|180 | 90 |90 | 50% | 50% 1 |AB|180 | 90 |45 | 50% | 25% I have the columns SNo,Sub,Total,Lang1 and Lang2 columns in Pivot, i am not able to calculate for

  • Pipelined functions and reports

    Hi all, please consider this test case: create type htmldb_obj as object ( a varchar2(10), b varchar2(10) create type htmldb_type2 as table of htmldb_obj; create or replace function htmldb_f2 (p number) return htmldb_type2 pipelined is begin pipe row

  • Different language

    Hi On my homepage I got a different language that I don't understand. Chinese i think. Could someone help me get it back to english?? [private info removed by moderator] Kim Andre

  • Iphoto won't recognize iphone?

    so i plug in my iphone 4s to iphoto so i can upload pictures, but instead of recognizing it as "my iphone" (that is the name of it) it comes up at "apple iphone" none of the photos show up there are just a bunch of squares with dotted lines around th