Making changes in web.xml dynamically

Hi all,
I have a requirement in which i need to redirect request to com site if it is from desktop browser and to WAP site if request for wap site or from a mobile device
Have servlet ready doing it but presently taking only to two harcoded URLS of .com and .mobile sites.in web.xml.
Now i want dynamic changes in web.xml through a servlet to changes those URLs to respective request.
Thanks in advance,
dcosta_halo

The web.xml file is only a data storage file. When a Java Web Server starts up, it read the web.xml file and creates the appropriate objects that live in the JVM and manage parts of the applications hosted by the server. Any changes to the web.xml data file while the server is running are lost once the server is turned off. You need to figure out another design, possibly having the servlet read a database table to get URL strings.

Similar Messages

  • After Making Changes In Log4j.xml Application Needs Recompilation?

    Hello,
    I am using log4j in my jsp pages and for that I instantiating Logger class like this
    Logger logger = Logger.getLogger("test.jsp");
    {code}
    And I have log4j.xml in the classpath.
    I believe, priority levels can be changed and log level can be changed without re-compiling.
    Change the log4j.xml and re-run jsp pages.
    However I need to re-compile after making changes in log4j.xml file. Without re-compilation changes are not getting reflected.
    Why I need to re-compile application in order to see the changes I have made in log4j.xml?
    Appreciate any help in this regard.
    Regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    This is the contents of my log4j.xml, its under WEB-INF/lib
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
      <!-- A1 is set to be a ConsoleAppender -->
      <appender name="sout" class="org.apache.log4j.ConsoleAppender">
        <!-- A1 uses PatternLayout -->
        <layout class="org.apache.log4j.PatternLayout">
          <param name="ConversionPattern" value="%d [%c] %p - %m%n"/>
        </layout>
      </appender>
      <root>
        <!-- Set root logger level to DEBUG and its only appender to A1 -->
        <priority value="off"/>
        <appender-ref ref="sout"/>
      </root>
    </log4j:configuration>

  • Can we change the web.xml file name???????

    can we change the name web.xml and struts-config.xml file to other name.....if yes, then how..........

    you can change the name of struts-congig.xml file
    and change the strut-config file name in web.xml also.
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
        <servlet>
            <servlet-name>action</servlet-name>
            <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
            <init-param>
                <param-name>config</param-name>
                <param-value>/WEB-INF/struts-config.xml</param-value>
            </init-param>And you also try rename the file web.xml and run the application and check what is happening...

  • Making changes to web access phone setting CUCM 8.6.2

    Hello,
    I have a question on a change I need to make on our Call Manager. We use the Berbee Informacast product for emergency notification. It requires that the Web Access parameter be enabled on the individual phones in order to send audio broadcasts. I have learned that after a certain version of CUCM (8.6 perhaps) this setting was set to disable by default on the Enterprise Phone Configuration section on CUCM. We have had this version running about a year now and many many phones have been installed since then. These phones have the web access disabled I believe because of this being disabled on the server settings side. My question is this...
    Would it be better to go into System > Enterprise Phone Configuration>Web Access setting and set to enable
    or
    Do a bulk edit on all phones to enable, reset phones.
    What I am not sure about also is if I change on the system side if it will automatically update and reset phones.
    Just not clear on the right path to take on this...
    Any ideas?
    Thanks,
    -Nick

    Thanks for the great info. This is what I did.
    Changed web access to enabled in Enterprise Phone Configuration. Clicked Ok, manually rebooted a couple of phones with no web access. Still didn't work.
    Changed web access to enabled in Device>Device Settings>Common Phone Profile>Standard Common Phone Profile. Clicked Save and rebooted the same two phones. Worked great.
    Ran job scheduler to reboot all phones (1600 of them) and all seems to be good now.
    Thanks again Chris!

  • Viewing ical in .mac-making changes from web

    Can anyone answer definitively the following:
    Can one's iCal be viewed at one's .mac account page, or does one need to "publish" it to the web?
    If the latter, is it even viewable from one's .mac account page?
    If "publishing" is necessary for remote viewing of one's iCal, can one alter it remotely (via .mac or the web from a computer other then one's own)?
    Apple's comments on all this are curiously vague.
    Thanks.
    emac   Mac OS X (10.4.4)  

    cue,
    1. Your iCal data is not viewable from the .mac page.
    2. When published, it must be viewed at the following URL> http://ical.mac.com/yourusername/yourcalendarname
    3. Publishing changes must be made from iCal on the original host computer, except that another Mac which is synced through .Mac could make changes if authorized.According to iCal Help...Synchronization is the process of updating information on different computers or devices so that all copies of your files contain the latest changes. For example, if you have calendars on more than one computer, you can synchronize them so that each computer has the latest information.
    If you have a .Mac membership, you can synchronize your calendars across multiple computers via the Internet. To synchronize calendar information on your computer, mobile phone, Palm OS device, or iPod, use iSync (in your Applications folder).
    ;~)

  • Configuring web.xml for OpenSSO

    Hello!
    I am developing simple web application and want to use opensso in my web application.I have downloaded opensso,deployed and configured ,so i dont need how to configure web.xml ,what filters and jars i needed,i have the simple web.xml
    <web-app>
         <security-constraint>
              <web-resource-collection>
                   <web-resource-name>admin</web-resource-name>
                   <url-pattern>/admin/*</url-pattern>
              </web-resource-collection>
              <auth-constraint>
                   <role-name>admin</role-name>
              </auth-constraint>
         </security-constraint>
         <login-config>
              <auth-method>FORM</auth-method>
              <form-login-config>
                   <form-login-page>/login.jsp</form-login-page>
                   <form-error-page>/error.jsp</form-error-page>
              </form-login-config>
         </login-config>
         <security-role>
              <role-name>admin</role-name>
         </security-role>
    </web-app>so what filter should i add in web.xml so that when i access admins page <url-pattern>/admin/*</url-pattern>it should redirect to opensso s login page?

    Yes, I restarted the app server after making changes to web.xml file. No effects.

  • Configuring web.xml for Weblogic Server 5.1

    Hi,
    I am working on Weblogic Server (WLS) 5.1 SP 12. I have a web application running on it. At present, it does not have a web.xml file. I want to use Front Controller pattern, and therefore I need to have a web.xml file (to specify the URL Pattern for Front Controller) inside WEB-INF directory on server. I have placed the web.xml file inside WEB-INF directory of application, and have marked the URL pattern. However, the application is not taking into consideration that thing, i.e. mu front controller is not getting into picture, its entry is being ignored. How to make sure that it is not by-passed?
    My application is not in a .war format. WLS 5.1 SP12 is running on Sun Solaris.
    Is there a way to make sure that the intended thing happens?
    Plz help.
    Regards,
    Raj

    Yes, I restarted the app server after making changes to web.xml file. No effects.

  • Is there any way to prevent web.xml from any change ?

    hi all,
    we have a filter in web.xml. Now we want to prevent it from any change in future. I mean after making a war(EAR) no one can change the filter in web.xml. if he chaged it then he will not be able to re deploy the application.Right now it is in web.xml so one can easily change it and then he can redeploy the application.
    Is there any way to prevent web.xml from any change after making EAR(WAR)?
    One can easily make a change in web.xml and redeploy the application to get the result. Now we want to restrict the web.xml as java class for any change after making EAR(or WAR).
    Could some one help me to do this?
    thanks,
    dinesh

    I think you could use some third party software to lock the folder like FolderLock, just make sure others ppl cannot access your file should be fined.
    This is my stupid solution only,cheers.

  • Is there any way to prevent web.xml from any change like java class?

    hi all,
    Is there any way to prevent web.xml from any change after making EAR(WAR)?
    One can easily make a change in web.xml and redeploy the application to get the result. Now we want to restrict the web.xml as java class for any change after making EAR(or WAR).
    Could some one help me to do this?
    thanks,
    dinesh

    hi,
    Not at development level. We want it after deploying the application on server .
    We want to create it (web.xml) at tomcat startup (or in any other web/app server ) before loading any context.
    Is there any way to run a simple java class(not servlet) on tomcat startup(before initializing the contexts)?
    Message was edited by:
    DP_java
    Message was edited by:
    DP_java

  • How can I change application's web.xml in NetWeaver CE 7.1?

    Hello Experts,
    Please help me. I need to configure a J2EE application on NetWeaver 7.1, but I don't know how I can change the web.xml of the application.
    The web.xml of the app needs to be modified during the configuration. This can be achieved via single-file-update in VA in Netweaver 6.4 or 7.0. But I cannot figure out how to do that in NW 7.1.
    Please show me how to do that or at least give me some hints.
    Thank you!
    Jack

    Hi Jack,
    In SAP NetWeaver 7.1 and later, you use the SAP NetWeaver Administrator instead of Visual Administrator.
    To get some information on how to configure web applications, try [THIS|http://help.sap.com/saphelp_nwce10/helpdata/en/45/48a60a528608d1e10000000a11466f/frameset.htm] piece of documentation.
    I hope it helps.
    Best,
    Yordan

  • Modifying Infoview web.xml

    i am modifying infiview web.xml but changes are not reflectin.
    just to test i changed home page to say aaa.com and restarted server.
    it should throw error but it is not...anybody can help me?
    thanks
    in advance

    i have developed a java web application and i am able to login through enterprise but not through windows Ad . for that i was making some changes in web .xml but nothing was happening so i tried to change the home page so that i can see changes are reflecting.
    I made changes in \Tomcat55\webapps\InfoViewApp\WEB-INF\web.xml
    <!-- The default home page -->
        <context-param>
            <param-name>homepage.default</param-name>
            <param-value>/jsp/listing/home.jsp</param-value>    </context-param>
    instead of <param-value>/jsp/listing/home.jsp</param-value>i am giving
    <param-value>google.com</param-value>
    according to me it should through error...but it is showing the page we see by  <param-value>/jsp/listing/home.jsp</param-value>    </context-param>
    so is it the wroung web.xml i am changing...

  • How to chage the welcome file in web.xml using creator?

    Hi guys,
    I want to set the welcome file in web.xml to index.html but every time I run my project in creator, creator replaces index.html by faces/index.jsp. I need the index.html to check if the browser enables cookies & javascript and then I redirect to index.jsp. If I change the web.xml in a common editor, build the war-file with ant and deploy the project with tomcat, everything is fine. but how can I change it in creator?
    thanks in advance

    Sorry, that doesn't make much sense.
    The XML you gave is a configuration file for txt2xml utility. It doesn't represent the output format.
    Are you a user of this utility?

  • Java.lang.IllegalArgumentException for listener in web.xml with weblogic12.1.1

    Hi.
    Im trying to upgrade the weblogic version from 10 to 12 for my application.
    Im getting below mentioned error while deploying ear file in weblogic 12 which works fine with version10.
    " java.lang.IllegalArgumentException:[HTTP:101164] User defined class com.ab.util.session object is not a listener as it doesnt implement the correct interface."
    Deployment is getting failed because of this error.
    If i comment out listener, deployment is success.

    HI Timo,
    Old Weblogic version: 10.3.3
    New weblogic version:12.1.1
    Using Struts frame work.
    SessionObject class:
    public class SessionObject implements HttpSessionBindingListener{
    public void valueBound( HttpSessionBindingEvent  event)
    public voind valueUnbound (HttpSessionBindingEvent  event)
    web.xml:
    <listener>
    <listener-class>com.ab.util.SessionObject</listener-class>
    <listener>
    I want to know that why im getting  " java.lang.IllegalArgumentException:[HTTP:101164] User defined class com.ab.util.session object is not a listener as it doesnt implement the correct interface"  error while deploying the ear file under version 12.1.1 when it is working fine with version 10.3.3.
    Should i make any changes in web.xml or should i include any jars???

  • Init parameter in web.xml throwing an error..?

    OK.. this is probably going to sound strange, but here goes:
    Here is my entry in the web.xml:
    <servlet>
              <servlet-name>ServletTestRunner</servlet-name>
              <servlet-class>
                   org.apache.cactus.server.runner.ServletTestRunner
              </servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>ServletTestRunner</servlet-name>
              <url-pattern>/ServletTestRunner</url-pattern>
         </servlet-mapping>Everything works fine - I pull up the servlet with the following URL (http://localhost:7001/CDCAppWeb/ServletTestRunner?suite=com.testcases.decision.service.SendCreditRequestBeanTest)
    , and receive the results in XML format. However, if I change the web.xml to have the following:
         <servlet>
              <servlet-name>ServletTestRunner</servlet-name>
              <servlet-class>
                   org.apache.cactus.server.runner.ServletTestRunner
              </servlet-class>
              <init-param>
                   <param-name>xsl-stylesheet</param-name>
                   <param-value>cactus-report.xsl</param-value>
              </init-param>
         </servlet>(notice the cactus-report.xsl init-param entry) - the servlet does not work. Actually, NONE of the other servlets in my application work when I put in this init-param for the ServletTestRunner. I have verified that the xsl is in the classpath (WEB-INF/classes).
    What I am missing... any ideas?

    I know what the problem is. If you call servlet with the default URL (http://host/app/servlet/package.Servlet) than Servlet DOES NOT read init parameters. I don't know why it was designed this way.
    To make servlet read init parameters, you have to assign it a name and then call it with that name, like this:
    <servlet>
    <servlet-name>ServletName</servlet-name>
    <servlet-class>package.ServletClass</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ServletName</servlet-name>
    <url-pattern>/app/path/ServletName</url-pattern>
    </servlet-mapping>
    You can then call servlet using path specified in url-pattern and read init parameters in the normal way.

  • Eclipse editor gives error for web.xml for jsp-config

    Hi All,
    I am using following web.xml . Eclipse europa editor gives warning if <jsp-config> is added. Is anyone have idea about it.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>     
         <display-name>Cart</display-name>               
         <servlet>
    <servlet-name>RequestHandler</servlet-name>
    <servlet-class>com.amazon.helper.LoginListener</servlet-class>
    </servlet>      
         <servlet-mapping>
    <servlet-name>RequestHandler</servlet-name>
    <url-pattern>cart.loginUser</url-pattern>
    </servlet-mapping>
    <jsp-config>
         <jsp-property-group>
         <url-pattern>*.jsp</url-pattern>
                   <scripting-invalid>true</scripting-invalid>
         </jsp-property-group>
    </jsp-config>
    </web-app>

    Your web.xml file is out of date.
    You have a DTD there for the Servlet 2.2 spec.
    The jsp-config tag was introduced to web.xml as of the Servlet 2.4 specification - which is why it is complaining in your editor.
    Seeing as you have Tomcat 6, I would recommend you change your web.xml to look like this
    - removed the DTD
    - change the web-app tag to include schema information
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
    <display-name>Cart</display-name>
    <servlet>
    <servlet-name>RequestHandler</servlet-name>
    <servlet-class>com.amazon.helper.LoginListener</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>RequestHandler</servlet-name>
    <url-pattern>cart.loginUser</url-pattern>
    </servlet-mapping>
    <jsp-config>
    <jsp-property-group>
    <url-pattern>*.jsp</url-pattern>
    <scripting-invalid>true</scripting-invalid>
    </jsp-property-group>
    </jsp-config>
    </web-app>Cheers,
    evnafets

Maybe you are looking for

  • My dad's iMac 24" 2009

    Hey, my dad has an iMac 24" 2009 model. He's been experiencing random freezes with his iPHoto, he runs iphoto 09' he only has less than 200 photos in there and it freezes out of nowhere. What can we do? We even tried to unplug our internet modem then

  • How to export netbeans source code to microsoft word

    Hi. I have just finished my school work in Computer Science by doing a program in net beans. when i am supposed to write the documentation i want to import the code into a word document and still make it look lite it does in net beans. How do i do it

  • Where'd my MPEG-2 go?

    I recently updated to Tiger and had some issues that required me to re-install FCP 4. I then went to the apple site and upgraded to 4.5 which is what I had been using. Now, when I try to export I no longer have a MPEG-2 option. I tried exporting usin

  • Itunes won't run after download

    itunes won't run after download. simply asks to acknowledge agreement which I did. help

  • Music crashes when loading a Smart Playlist

    Whenever I try to load a Smart Playlist, it crashes the Music app. I tried making the playlist smaller, and it helped some, it's still extremely slow in opening - much more so than a much larger playlist I created myself. Worse, if it crashes while p