Problem if i use web.xml

hi,
i am developing a project using servlets and jsp's, i am using JSTL for the jsp pages (c.tld) but it is not working if there is web.xml file with out this it is working fine
i dont know what exacltly the problem plzz xove this problem
cheers,
Aleem Basha,

What error message are you getting?
What Server are you using? Version?
What version of JSP are you using? 1.2 or 2.0?
What version of JSTL are you using? 1.0 or 1.1?
See [url http://forum.java.sun.com/thread.jspa?threadID=629437&tstart=0]this thread (reply #6)  for version issues using JSTL in various servers.

Similar Messages

  • What is the best way to find a file on the servers disk without using web.xml?

              What is the best way to find a file on the servers disk without using web.xml?
              I want to find a configuration file not contained within the war file I have
              created. Is there a way to pass information into the ServletContext with out
              rebuilding the ear or war files? Tomcat 4.0 can do this in its server configuration
              files. Does BEA have the equivalent?
              Regards,
              Eric
              

    You can specify the path to the file as a system property
              eg
              java -Dconfig.file.location=./mydirecotry/myfile.txt com.test.MyApp
              "Eric White" <[email protected]> wrote in message
              news:[email protected]..
              >
              > What is the best way to find a file on the servers disk without using
              web.xml?
              > I want to find a configuration file not contained within the war file I
              have
              > created. Is there a way to pass information into the ServletContext with
              out
              > rebuilding the ear or war files? Tomcat 4.0 can do this in its server
              configuration
              > files. Does BEA have the equivalent?
              >
              > Regards,
              > Eric
              

  • How to run java servlet without using Web.xml?

    How to run servlet without using Web.xml? From a book, I know that web.xml descriptor is optional, but the book doesn't tell us how to run java servelet without web.xm descriptor. So how to do that? Thanks a lot.

    How to run servlet without using Web.xml?But Tomcat now uses a web.xml for its global server-wide configuration.
    If you'd like to invoke a servlet with:
    http://host/servlet/ServletName
    you have to enable the invoker servlet.
    [from an HTML]
      <FORM METHOD="POST" ACTION="/servlet/HGrepSearchSJ">
    [from resin.conf of Resin Web Server 2.1.12]
      <!--
         - The "invoker" servlet invokes servlet classes from the URL.
         - /examples/basic/servlet/HelloServlet will start the HelloServlet
         - class.  In general, the invoker should only be used
         - for development, not on a deployment server, because it might
         - leave open security holes.
        -->
      <servlet-mapping url-pattern='/servlet/*' servlet-name='invoker'/>
    [from TOMCAT5.0.19/conf/web.xml, a global server-wide web.xml file]
      <!-- The "invoker" servlet, which executes anonymous servlet classes      -->
      <!-- that have not been defined in a web.xml file.  Traditionally, this   -->
      <!-- servlet is mapped to URL pattern "/servlet/*", but you can map it    -->
      <!-- to other patterns as well.  The extra path info portion of such a    -->
      <!-- request must be the fully qualified class name of a Java class that  -->
      <!-- implements Servlet (or extends HttpServlet), or the servlet name     -->
      <!-- of an existing servlet definition.     This servlet supports the     -->
      <!-- following initialization parameters (default values are in square    -->
      <!-- brackets):                                                           -->
      <!--                                                                      -->
      <!--   debug               Debugging detail level for messages logged     -->
      <!--                       by this servlet.  [0]                          -->
        <servlet>
            <servlet-name>invoker</servlet-name>
            <servlet-class>
              org.apache.catalina.servlets.InvokerServlet
            </servlet-class>
            <init-param>
                <param-name>debug</param-name>
                <param-value>0</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>
        </servlet>
    ---comment out below----------------------------------------------------------
        <!-- The mapping for the invoker servlet -->
    <!--
        <servlet-mapping>
            <servlet-name>invoker</servlet-name>
            <url-pattern>/servlet/*</url-pattern>
        </servlet-mapping>
    -->

  • Define a context parameter not using web.xml

    Dears,
    With a web.xml file, it is possible to define a context parameter available in the web app via de ServetContext.getInitParameters method.
    Is it possible to define a context parameter not using the web.xml file ? Can I, in a java Class, init a custom context parameter ? (for exampel, init as a context param a key/value pair read from a property file).
    PS: the need is that the value (hmac key) currently define in the web.xml needs to be updated monthly. Apparently, under WebSphere (the app server we are using) changing the web.xml of the deployed app it not enought for it to be taken into account.
    Sincerely,
    Beno�t Bertrand

    Is it possible to define a context parameter not
    using the web.xml file ? Can I, in a java Class, init
    a custom context parameter ? (for exampel, init as a
    context param a key/value pair read from a property
    file).Does it necessarily have to be a value retrieved through the context param ? AFAIK, there's no way you could programatically 'set' an init param, which going by the name, 'init param' is quite understandable.
    You could define this value in a property file and read it in, in the init method. You should provide a mechanism to reload the new value after 'x' days. One approach is a Timer that does the job, do have a look at SteveJLuke's recommendations on the same in this thread
    http://forum.java.sun.com/thread.jspa?threadID=637355&tstart=0cheers,
    ram.

  • Display error page using web.xml error-page

    I need to dispaly error page when IOException in thrown. How to do that with web.xml error-page tag?
    start.jsf
    public String doButton1Action() throws IOException{
              String value = getText1().getValue().toString();
              try {
                   File f = new File(value);          
                   InputStream in = new FileInputStream(f);
              } catch (IOException e) {
                   throw new IOException();
              return "success";
         }I have this in web.xml:
         <error-page>
              <exception-type>java.io.IOException</exception-type>
              <location>/ioerror.jsp</location>
         </error-page>

    I tried that earlier but then I get error just printed to console and HTTP 500 - Internal server error -page, bubt not my errorPage.
    [26.1.2007 21:19:16:543 EET] 00000038 jsf           E com.sun.faces.lifecycle.InvokeApplicationPhase execute #{pc_Start.doButton1Action}: javax.faces.el.EvaluationException: java.io.FileNotFoundException: c:\temp\ghostfile.jpg
                                     javax.faces.FacesException: #{pc_Start.doButton1Action}: javax.faces.el.EvaluationException: java.io.FileNotFoundException: c:\temp\ghostfile.jpg
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:79)
         at javax.faces.component.UICommand.broadcast(UICommand.java:312)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:298)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:412)
         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
         at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
         at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
         at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
         at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
         at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
         at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
         at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
         at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
         at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
         at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
    Caused by: javax.faces.el.EvaluationException: java.io.FileNotFoundException: c:\temp\ghostfile.jpg
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:131)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:73)
         ... 25 more

  • Export to Excel Problem external DC using Web Dynpro binary cache

    Hallo,
    I want to export from Web Dynpro to Excel. For this I study the Tutorial "Excel Export Using the Web Dynpro Binary Cache".
    The example is running without a problem.
    I have create a new DC only for excel export. The name is ExcelExportWD. In this DC I create a Component and programmed the methods of the example. Also I create the View and the Context for it.
    This DC is used in other DCs. I put the Component to the public part. After than I make the entry in the used DCs in that DC which I want to use the Excel export. I use the DC ExcelExportWD in the DC ContactsWD.
    The ContactsWD is running without a problem.
    If I try now to export to Excel I got the following error.
    <b>com.sap.tc.webdynpro.services.sal.api.WDDispatcherException: Requested deployable object 'mgi.de/portalscmContactsWD' and application 'ResultGetContacts.xls' are not deployed on the server. Please check the used URL.</b>
    In the View of the ExcelExport the name of file is not visible in the URL of the ExcelFileName. The name "ResultGetContacts.xls" is the name of the node which I want to export.
    What is wrong? I have try to set a Sharing reference in the ContactWD without success.
    An idea ?
    Regards
    Gunter

    Hallo,
    I want to export from Web Dynpro to Excel. For this I study the Tutorial "Excel Export Using the Web Dynpro Binary Cache".
    The example is running without a problem.
    I have create a new DC only for excel export. The name is ExcelExportWD. In this DC I create a Component and programmed the methods of the example. Also I create the View and the Context for it.
    This DC is used in other DCs. I put the Component to the public part. After than I make the entry in the used DCs in that DC which I want to use the Excel export. I use the DC ExcelExportWD in the DC ContactsWD.
    The ContactsWD is running without a problem.
    If I try now to export to Excel I got the following error.
    <b>com.sap.tc.webdynpro.services.sal.api.WDDispatcherException: Requested deployable object 'mgi.de/portalscmContactsWD' and application 'ResultGetContacts.xls' are not deployed on the server. Please check the used URL.</b>
    In the View of the ExcelExport the name of file is not visible in the URL of the ExcelFileName. The name "ResultGetContacts.xls" is the name of the node which I want to export.
    What is wrong? I have try to set a Sharing reference in the ContactWD without success.
    An idea ?
    Regards
    Gunter

  • Form based authentication problem - security constraint in web.xml

    Hi ,
    I have j_security_check in my login page
    <form name="loginForm" id="loginForm" method="post" action="j_security_check">
         <table id="login" align="center" cellspacing="0" cellpadding="0">
                   <tr>
                        <td class="label">Name</td>
                        <td class="value"><input id="j_username" name="j_username" value="" type="text" ></td>
                   </tr>
                   <tr>
                        <td class="label">Password</td>
                        <td class="value"><input name="j_password" type="password"></td>
                   </tr>               
                   <tr>
                        <td colspan="2" class="submit"><input type="submit" name="Submit" value="Log in >>"></td>
                   </tr>
         </table>
         </form>
    And my web.src consists the following
    <security-constraint>
              <web-resource-collection>
                   <web-resource-name>EP</web-resource-name>
                   <url-pattern>/*</url-pattern>
              <http-method>GET</http-method>
              <http-method>POST</http-method>
    </web-resource-collection>
              <auth-constraint>
                   <role-name>EP</role-name>
              </auth-constraint>
              <user-data-constraint>
                   <transport-guarantee>CONFIDENTIAL</transport-guarantee>
              </user-data-constraint>
         </security-constraint>
    <login-config>
              <auth-method>EPULSE</auth-method>
              <realm-name>AuditManager</realm-name>
              <form-login-config>
                   <form-login-page>/login.jsp</form-login-page>
                   <form-error-page>/error.jsp</form-error-page>
              </form-login-config>
         </login-config>
    After I start the tomcat server I can go to the login page, however when I enter the username and password and press enter..
    http://localhost:8443/au/j_security_check ...
    Can you please advise me whether there is a problem in this?
    Manisha

    Please read the Servlet specification for details on how to specify url-patterns (see section 11.2). Your "index.*" is not a legal pattern. You can only end in "/*" or "*.foo". See Servlet spec.
    If after fixing that you have more questions, please include the actual sequence of requests (and responses), preferably from a network snoop.

  • What is web.xml and why it is used?

    hi,
    am new to servlet technology, i tried to find a topic like this in this fourm also in google but didn't get a exact one. can anybody explain me or suggest me some resource about this.
    thanx in advance.
    Max

    hi stevejluke,
    thanx for the correct link.
    nx for the correct link. but what i in doubt with is
    why we should use web.xml? may be my question is very
    silly, may be too basic, forgive me for that...
    Thanx & Regards,
    SaikatAt the most basic level:
    There are several versions of the Servlet specification, You need the web.xml to tell the server which version of the spec your application conforms to so the server knows how to deal with different things.
    If you have a servlet, you also need the web.xml to define what URL signals a request that should be handled by your servlet.
    At this point, you need to sit down and read a book. Do what it says, blindly at first. Just do what it says (but do try to understand the 'what' of it, just don't question the 'why'). After you have a few applications running, go back and ask yourself this question again and try to see what you are using the web.xml for in those applications you have.

  • Setting up JNDI resources in web.xml only

    Hi,
    I'm using Tomca 4.0 LE and JDK 1.4.0_01.
    I've been using a database connection pool on my local machine by editing the server.xml file and web.xml. However, I need to move the webapp onto a web hosting compaines server (same tomcat and jdk version). I cannot edit the server.xml file, so I need to set up my JNDI resource in web.xml only.
    I have done this (in web.xml):
    <resource-ref>
          <res-ref-name>jdbc/ocb_clients</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
      </resource-ref> Now, before when I had this all set up in web.xml, I had a list of <ResourceParams> within the <context> element:
    <ResourceParams name="jdbc/ocb_clients">
        <parameter>
          <name>factory</name>
          <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
        </parameter>
        <parameter>
         <name>username</name>
         <value>username_here</value>
        </parameter>
        <parameter>
         <name>password</name>
         <value>password_here</value>
        </parameter>          
        <parameter>
           <name>driverClassName</name>
           <value>org.gjt.mm.mysql.Driver</value>
        </parameter>       
        <parameter>
          <name>url</name>
          <value>jdbc:mysql://localhost:3306/ocb_clients</value>
        </parameter>
      </ResourceParams>These parameters are obviously needed for the datasource to work. How can I set these up just using web.xml?
    Also, this code is from a servlet that I have loading on tomcat startup. Will this still work with the new configuration?
    public void init() throws ServletException
         DataSource ds = null;       
         try
           //Set up the inital context
           Context ctx = new InitialContext();
           //Look up the database
           ds = (DataSource) ctx.lookup("java:comp/env/jdbc/ocb_clients");
         catch(NamingException nameE)
           System.err.println("Error looking up database: " + nameE);
         //Add the datasource to the application scope
         getServletContext().setAttribute("ocbDatabase", ds);
      }Any help is greatly appricated,
    Thanks, Mel.

    I am Having exactly the same problem with tomcat 5.0. I have tried to do everything mention as solutions at different fourums but I failed.
    BTW I am using MySQL
    Thanks
    Dibakar

  • Where to save web.xml file in apache jserv with servlet 2.0

    hi,
    we are using apache jserv which included servlet 2.0 we are able to run .class files and
    jsp files,but we are using web.xml file for connection pooling which we were used in tomcat
    but we are unable to find web-inf folder in apache/jserv to save the file.
    please help me out in this problem,
    please guide us is there any other method of connection pooling apache jserv,we are using backend
    as oracle9i
    i will be greatfull to u in this regards
    laiq

    Hi,
    Just create WEB-INF folder and copy the web.xml.
    good luck !
    ...san :-)

  • Need HELP!! Where I have to place an web.xml(servlet) file on server

    I'm using E-business suite for oracle HR version 11.
    On localhost i have developed an servlet file with using web.xml. On web.xml i have customized the file that can load a class for my servlet.But when I deploy on the server i had a cnfused wher do i have to place web.xml and my servlet.
    I have made an servlet file for my custom. Where do I have to place an xml(servlet) file on server?
    Would you give me know forsolving my problem.Please give me know,I really appreciated if you want to give some solution.
    Regards,
    Dany Fauzi

    Copy web.xml to WEB-INF directory of the web application.

  • Using an XML Bean in a WS Client app

    We're experience problems trying to use a XML Bean returned to a Java application from a WebLogic Workshop Web Service. As a test case we decided to write a Java application that would use the CustomerDB_XMLBeanClient Web Service supported in the SamplesApp application. This Web Service supports a getAllCustomerNames method which returns an XCustomerDocument object generated from an XML Bean. Invoking this method from the WS test page returns three (3) names. We then created a Java Proxy for this WS to import into our client application. This proxy has different method signatures than the WS. The equivalent getAllCustomerNames method returns an XCustomer object. The return object only has one name, the last one. The java proxy jar file does not have any of the XML Bean classes associated with this Web Service, nor can we find any methods that allow us to iterate through the multiple rows returned in an XCustomer object. So far all of the Java client examples that we've looked at utilize an XML Bean's Document Factory class to instantiate an XML Bean. Do we need to import the XML Bean classes in addition to the Java proxy jar? Can anyone provide us with a working example of a Java client application that receives an XML Bean return object from a Web Service? Thanks.

    The answer:
    emoticons.put("<3", ClassLoader.getSystemClassLoader().getResource("images"+File.separator+"heart.gif").toString());// <3The above solution worked for me when i put the images folder in the default package.
    And to present the file in an image on JEditorPane:
    if(msg.contains("<3")){ // alternately iterate key elements in map
         msg.replaceAll("<3","<img src=\""+emoticons.get("<3")+"\">");
    }This was the only problem I had and it has now been solved!
    If you have any problems with the same thing, post a message and we'll figure it out.

  • Servlet configuration in Weblogic 5.1.. web.xml vs weblogic.properties..

    Can someone please tell me how the <servlet> entry differs from
              weblogic.httpd.register.snoop=examples.servlets.SnoopServlet
              in weblogic properties?
              Do these perform identical functions?
              

    Yes this is the source of my confusiong. It seems to be that WL can be told
              about servlets
              two ways. Firstly through the web.xml file and also via weblogic.properties.
              I don't understand
              why the second one exists.
              "Cameron Purdy" <[email protected]> wrote in message
              news:[email protected]...
              > I only work with WAR files, so I cannot speak to non-WARd servlets with
              any
              > confidence. I know that WL could use web.xml for non-WARd servlets in
              order
              > to obtain the other information associated with the servlet:
              >
              > <!ELEMENT servlet (icon?, servlet-name, display-name?, description?,
              > (servlet-class|jsp-file), init-param*, load-on-startup?,
              > security-role-ref*)>
              >
              > --
              >
              > Cameron Purdy
              > http://www.tangosol.com
              >
              >
              > "Robert Nicholson" <[email protected]> wrote in message
              > news:[email protected]...
              > > If what you say is true then why is there the need to also tell WL about
              > the
              > > servlets themselves?
              > >
              > > Presumably this is for when the servlets exist outside of a WAR then?
              > >
              > > "Cameron Purdy" <[email protected]> wrote in message
              > > news:[email protected]...
              > > > The weblogic.properties tells WL to load a WAR or specific servlet.
              The
              > > > <servlet> entry (I assume you refer to
              > > > http://java.sun.com/j2ee/dtds/web-app_2_2.dtd) defines the presence of
              a
              > > > servlet within a WAR (a deployment unit):
              > > >
              > > > >
              > > > The servlet element contains the declarative data of a
              > > > servlet. If a jsp-file is specified and the load-on-startup element is
              > > > present, then the JSP should be precompiled and loaded.
              > > > [end-quote]
              > > >
              > > > In the case of a WAR deployment, you have to tell WL that the WAR
              > exists,
              > > > then it will look in the WAR and figure out what servlets are there
              from
              > > the
              > > > <servlet> tags in your web.xml. You set up a WAR in the
              > > weblogic.properties
              > > > as such:
              > > >
              > > > weblogic.httpd.webApp.<http-path>=<os-path>
              > > >
              > > > For example:
              > > > weblogic.httpd.webApp.website=c:/weblogic/website.war
              > > >
              > > > --
              > > >
              > > > Cameron Purdy
              > > > http://www.tangosol.com
              > > >
              > > >
              > > > "Robert Nicholson" <[email protected]> wrote in message
              > > > news:[email protected]...
              > > > > Can someone please tell me how the <servlet> entry differs from
              > > > >
              > > > > weblogic.httpd.register.snoop=examples.servlets.SnoopServlet
              > > > >
              > > > > in weblogic properties?
              > > > >
              > > > > Do these perform identical functions?
              > > > >
              > > > >
              > > >
              > > >
              > >
              > >
              >
              >
              

  • Web.xml

    Please let me where to put web.xml in Oracle Application Server and how to deploy an application in Application server.

    Debu,
    We are not using OC4J. We are using apache for our application. We are placed our web.xml in Web-inf folder. But we are unable to get parameters or other functionality using web.xml. Can you tell me how to handle web.xml in this case.
    Thanks
    Sudha

  • Missing application web.xml

    hi,
    tomcat loads my application but then does not recognise the web.xml file i have placed in WEB-INF folder of my application, resulting in:
    missing application web.xml, using defaults only.
    can anyone tell me how to go about resolving this.
    Cheers,
    dswill

    If you are using the application which uses web.xml data then if your application is getting loaded then that means that it is using your web.xml.
    But you r saying that it is using some defaults. so please check whether there is some comments continued and not allowed to using your tags.ie., whether our code is commented.

Maybe you are looking for

  • Can't download any file

    Hai iam using iPhone 5 and I can't download any file even a text please help me

  • Any idea how to get Blackboard Collaborate to run using Java 6?

    Up until Oct 22, I was able to load Blackboard collaborate without any problems.  Now it will not load.  It gets stuck trying to access Java 6.  Blackboard says it is a Java problem.  Java says it does not support Java 6 to consult Apple.  I am runni

  • Sending Approval Request to multiple Approvers

    Hi All, I'm facing problem in sending Approval request to multiple approvers.I have List of accountid's to which approval Requet has to be sent.I tried giving multiple id's in the "Owner" field of mannual action, which is not working.can any one let

  • Clear settings on 7911

    How do I clear all settings to include network settings on a 7911? What information can't be cleared with this process? We are trying to use a phone for a sensitive and non-sensitive network. We need to be able to clear the phone before switching and

  • How to program myRIO processor with LabVIEW?

    Hi, I am working on a project using myRIO. Now, I have a labview program and it can run very well on PC, with usb connection to myRIO. What I want to do next is to run this LabVIEW program on myRIO processor, without the PC. How can this be realized?