Tomcat redirection

When deploy web application to tomcat 5.5.9, if I type www.myhost:port/myapplication, then browser will display the application's directory.
How do I redirect the URL to a specific index.jsp file instead of displaying the directory ? So when I type www.myhost:port/myapplication and then it automatically redirect to:
www.somedomain.com/myapplication/jsp/index.jsp.

Put an index.jsp or index.htm in your application root directory that does the redirect for you.

Similar Messages

  • Apache + JK + Tomcat: Redirecting specific URL to a servlet

    Hi, everybody!
    I'm searching for a solution to my question for some time, but didn't find anything clear enough.
    So, my situation is:
    I have Apache 2.2 and Tomcat installed on my server. Apache is using JK Connector to send request to Tomcat.
    What do I need:
    I have a servlet that could be accessed through "http://mydomain.com/site/*". I can access, through this servlet, any of the site's sections. Like http://mydomain.com/site/news, http://mydomain.com/site/movies or http://mydomain.com/site/tech.
    I need to figure out a way of pointing one URL to each of these sections, but without changing the user URL. In other words, I have the domains www.mynews.com, www.mymovies.com and www.mytech.com, and would like that each one of these domains redirect to their respective servlet.
    So, is there a way of accomplish this task?
    Thank you,
    CaioToOn!

    Hi!
    I'm already mapping the final part of the URL. eg: "news", "tech".
    What I need is a way of mapping a domain to a sub-url, but avoiding changes on the user's browser url.
    I'm searching for a few days on the Tomcat manual, Apache manual and forums, but nothing like what I need 'til now. I'm still searching, but if someone there already know, I'll be very happy! I got kind of urgency.
    Thank you, again!
    CaioToOn!

  • Tomcat Redirection through DNS Alias

    Hi,
    We've just upgraded from BOE XI 3.1 SP2 to SP6 FP 6.3 which also upgraded Tomcat 5 to Tomcat 7.
    We used to access InfoViewApp using an alias in Tomcat 5. E.g https://wuinsights.wuintranet.net/
    This site redirects to https://wuinsights.wuintranet.net/InfoViewApp/logon.jsp and displays the InfoView Login Page.
    Since the upgrade to Tomcat 7, the redirection is not working anymore. It fails to load the page throwing the error: "Internet explorer cannot display the page."
    Direct link to Tomcat however works fine i.e https://<servername>:8443/ redirects to https://<servername>:8443/InfoViewApp/logon.jsp (set on the ROOT folder using index.html)
    We are not using Apache Redirector (httpd).
    I've checked the old server.xml file but could not find any entry of wuinsights.wuintranet.net in the <HOST> or <Engine> parameters.
    Ping, telnet to wuinsights.wuintranet.net resolves to the IP address of the Tomcat Server.
    Could anyone please let me know where/which file do we set this redirection in Tomcat?
    Appreciate your input.
    Thanks,
    Mingthingla Keishing

    Hi,
    Good to see you. If you were able to access your infoview page using https://wuinsights.wuintranet.net/InfoViewApp/logon.jsp it means your SSL port for the tomcat was 443.
    Currently it is not working for you in tomcat 7 but https://<servername>:8443/InfoViewApp/logon.jsp works for you.
    The issue is your tomcat 7 SSL port is 8443 which needs to be changed to 443. 8443 is the default SSL port for tomcat which needs to be changed manually.
    This can be easily changed in server.xml.
    Hope it helps.
    Regards
    Chinmaya

  • How to deny an ip to visit webapp and redirect to a specific page in Tomcat

    Hello,
    I need to use tomcat to deny some ips:
    <Context path="" docBase="${catalina.home}/webapps/ROOT">
         <Valve className="org.apache.catalina.valves.RemoteAddrValve" deny="202.106.186.*,202.108.36.*,202.108.44.*,202.108.45.*,202.108.5.*,202.108.9.*,220.181.12.*,220.181.13.*,220.181.14.*,220.181.15.*,220.181.28.*,220.181.31.*,222.185.245.*,202.165.100.*,220.181.19.*,159.226.50.*,202.108.11.*,202.108.22.*,202.108.23.*,202.108.249.*,202.108.250.*,61.135.145.*,61.135.146.*,64.124.85.*,61.151.243.*,202.165.96.*,216.239.33.*,216.239.35.*,216.239.37.*,216.239.39.*,216.239.51.*,216.239.53.*,216.239.55.*,216.239.57.*,216.239.59.*,64.233.161.*,64.233.189.*,66.102.11.*,66.102.7.*,66.102.9.*,66.249.64.*,66.249.65.*,66.249.66.*,66.249.71.*,66.249.72.*,72.14.207.* ,61.135.152.*,65.54.188.*,65.54.225.*,65.54.228.*,65.54.229.*,207.46.98.*,207.68.157.*,194.224.199.*,220.181.8.*,221.239.209.*,217.212.224.*,219.133.40.*,202.104.129.*,61.135.157.*,219.142.118.*,219.142.78.*,61.135.132.*,220.181.26.*,220.181.19.*,61.135.158.*,66.196.90.*,66.196.91.*,68.142.249.*,68.142.250.*,68.142.251.*,202.165.102.*,202.160.178.*,202.160.179.*,202.160.180.*,202.160.181.*,202.160.183.*,72.30.101.*,72.30.102.*,72.30.103.*,72.30.104.*,72.30.107.*,72.30.110.*,72.30.111.*,72.30.128.*,72.30.129.*,72.30.131.*,72.30.133.*,72.30.134.*,72.30.135.*,72.30.216.*,72.30.226.*,72.30.252.*,72.30.97.*,72.30.98.*,72.30.99.*,74.6.74.*,202.108.4.*,202.108.4.*,202.108.33.*,202.96.51.*,219.142.53.*"/>
    </Context>
    this ip is some spiders, but my manager need me to redirect those spiders to a specific page like index.jsp (which is not at the same tomcat server).
    It is very appreciated if you could give some advise,Thanks a lot!

    Implement a Filter which compares HttpServletRequest#getRemoteAddr() with the blacklist and map this filter on /*.
    You can issue a redirect using HttpServletResponse#sendRedirect().

  • Redirect subdomain to tomcat

    Hi,
    I'm getting confused. I want to forward requests of a subdomain (cms.klimtoren.be) to tomcat.
    Tomcat is installed and working at http://localhost:8080/cms (located at /Library/Tomcat/)
    I also use the webserver of mac for static content at www.klimtoren.be and others.
    I've read a lot about mod_jk and mod_proxy_jk, but I can't let  work.
    What configuration should I write at /Library/Server/Web/apache2/... .conf and on Tomcat side?
    I've read that it should be simple...
    (Sorry for the bad English)
    Thanks
    BakGat

    You'll probably know at least some of the following, if not all of it, and this reply probably isn't going to be the answer you're looking for.
    In general, DNS responses can redirect to different domains, but DNS and web browsers don't redirect to different ports.    Yes, there are technically DNS responses which can specify ports, but AFAIK no mainstream web browsers use those service records.
    The usual approach to redirect to a non-default port is a rewrite rule in the Apache configuration file, or potentially what's effectively a form of port forwarding at some intermediate network device, or what's known as an Apache reverse proxy.  For what I've seen of the approach you're looking at — the JK and AJP stuff — that's usually an Apache reverse proxy and usually some mod_rewrite URL rewriting.
    Now if you're looking to have some web site use Tomcat without sending the network connections there, then mod_jk and the connector and the reverse proxy and a rewrite rule or two is probably your path.   In general, you'd set up the web site via Server.app for the target domain, then the port forwarding and any necessary firewall rules at whatever device you're using for NAT, then establish the DNS domain translation on the external DNS servers with an IP address of your external static DNS.  Then you're manually editing in the configuration files.  With Server.app 3.0.x, the active Apache configuration files are located underneath /Library/Server/Web and are not the copies that can be found out in the traditional Unix directory locations. 
    If you've set up Tomcat and JK and some specific rules and they aren't working, then the usual path is to check the Apache web server logs for syntax errors, and to verify the syntax of the Apache configuration files.   Console.app is good for checking the logs from the GUI (Server.app, rather less so), or access the Apache logs directly from the command line.
    There are some low-level details on the Apache set-up in the 10.9 Mavericks Server.app 3.0 environment:
    cat /library/server/web/config/apache2/readme.txt
    The configuration test for syntax errors with Server.app 3 on 10.9 Mavericks Server:
    apachectl -f /library/server/web/config/apache2/httpd_server_app.conf -t
    If as it appears, you're already well along working with mod_jk and mod_rewrite and the reverse proxy already and it's not working, please post the settings you're using, and any relevant errors from the Apache and Tomcat / Catalina logs.
    I haven't had to set up or troubleshoot Tomcat on Mavericks yet, so somebody else may be able to get you better details here, and I don't know of any Tomcat / Catalina / Apache guide that applies to OS X Server and Server.app 3.0.x environment.

  • How to redirect all Tomcat request to a servlet

    How can I set up Tomcat to redirect all request to a certain sevlets which sends the user to the right web-application.
    What ever the user type in the URL, i.e.:
    http://customer01.myDomain.dk
    or
    http://customer02.myDomain.dk
    or
    http://customer01.myDomain.dk/myApp/login.jsp
    - I want tomcat to redirect to a servlet class. Is that possible?
    Thanks

    Yes but pretend each customer has more than one web-application. Then it is not possible for the customer to use only this URL:
    http://customer01.myDomain.dk
    Each customer need a seperate url for each application, something like this:
    http://customer01.myDomain.dk/myApp01/login.jsp
    http://customer01.myDomain.dk/myApp02/login.jsp
    ( easy URL�s they can remember )
    And I don�t think it is possible to make an alias to the exact URL to the web application. That�s why I need Tomcat to redirect all request to i.e. Index.jsp which then redirect to the correct application.
    Here is an example:
    Customer01 type in:
    http://customer01.myDomain.dk/myApp01/login.jsp
    Tomcat calls Index.jsp which redirect to this URL:
    http://www.myDomain.dk/myApp01_ID0921/login.jsp
    Can you help me with this problem?

  • Redirect HTTPS traffic to HTTP in Tomcat

    Hi,
    We are running SAP BI Platform 4.0 SP2 Patch 7, which runs on top of Tomcat 6.
    We have succesfully configured our iPads to connect to our SAP BusinessObjects server using HTTPS in internet. We have an application proxy that handles HTTPS and sends plain HTTP to the SAP BusinessObjects server.
    The problem is that same connection do not work when users are accessing our intranet, because the SAP BusinessObjects server only accepts HTTP requests in port 8080.
    I have seen that Tomcat allows automatic redirections from HTTP to HTTPS ( using redirecPort parameter in HTTP connector definition ).
    But is it possible the opposite, to switch automatically HTTPS to HTTP ?
    Regards,
    Joan

    Hi,
    At last we have activated HTTPS support in Tomcat. The idea was to avoid HTTPS in BOBJ servers to save CPU usage but after some tests we can afford it.
    So no redirections are needed and the question is solved.
    Thanks,
    Joan

  • How to redirect tomcat's (not in jwsdp) output  to catalina.out

    how to redirect tomcat's (not in jwsdp) output from consolee to catalina.out

    Finally we solve this.
    In startup.bat we've changed string
    call "%EXECUTABLE%" start %CMD_LINE_ARGS%
    to
    call "%EXECUTABLE%" run %CMD_LINE_ARGS% 1>..\logs\catalina.out 2>..\logs\catalina-err.out
    (the above in one string)
    May be someone know something better?

  • Redirecting requests to a different tomcat

    Hi,
    I have two tomcat 5 installations running in my server. I have enabled the load-balancing feature of tomcat via apache.
    The load-balancing and failover is working fine for me to redirect requests for all the webapps under a tomcat. Can this be done for a single webapp alone ?
    What i mean to say is if I go to the tomcat1 manager UI and stop one of the webapps, then the requests for that webapp should alone be served from tomcat2 ...
    Please get back if iam not clear

    no experience with tomcat 5 laodbalancing, but if it really is enabled it should work when only 1 of the 2 is active.

  • How to redirect the tomcat (5.0) console output to a text file

    Hello,
    I am looking for a way of redirecting the tomcat console output [the System.out.println("xyzabc")�s from the java classes running on the container] to a text file.
    The reason is that the programmers need to have that console�s output and the server (windows) have to be rebooted often (no wonder: windows) and then Tomcat start as a service -> console is not visible.
    Thanks!

    The console out put should still be in the log files if tomcat is running as a windows service. It will either be in logs\stdout_xxxx.log and logs\stderr_xxxx.log or in logs\catalina.xxxx.log.
    If you are using 5.5.
    It will either be in logs\stdout.log and logs\stderr.log or in logs\catalina.out.
    if you are using 5.0

  • Dreaded redirect loop with tomcat hot deploy

    I have an OpenSSO 8.0 installation on a glassfish server, and a Tomcat 6.0.20.1 client installation. I have set Configuration > Servers and Sites > Server > Security > Encode Cookie Value to true. For normal use, it works just fine. However, if I place a war file in the webapps directory, which tomcat recognizes and automatically explodes and deploys, from this point on all of my protected apps give me the redirect loop until I restart tomcat. Has anyone else ever seen this, or know how to fix it? We regularly use tomcat's hot deploy capabilities, and it is a major drawback if we have to cycle tomcat every time we deploy an app.
    Thanks.

    As an independent test, are you able to deploy and run the ADF Toy Store demo application on the same tomcat with no problems as documented in the ADF Toy Store Demo whitepaper's section on running on tomcat?
    http://www.oracle.com/technology/products/jdev/tips/muench/adftoystore1012/readme.html#tomcatsetup
    Might help us narrow down the problem.

  • Redirecting Tomcat output

    I am using Tomcat 5.0.28.
    My code uses the System.out.println( ) statements.
    However the output is redirected to the stdout file in Logs folder in Tomcat installation directory.
    I intend to see the output on the console.How can I redirect the outtput to the console and not to the stdout file?
    Any suggestion would be appreciated.

    File f = new File(logFile);
    printStream = new PrintStream(new BufferedOutputStream(new FileOutputStream(f)), true);
    System.setErr(printStream);
    System.setOut(printStream);
    System.out.println("Log started: " + new java.util.Date());When the virtual machine starts, System.out, a singleton object of type PrintStream, is hooked up to the console. You can then call print() and println() on this stream and have it show up there. Using System.setOut(), you can change this object and have it point somewhere else, such as a file. In this case, the variable log�File holds this location and becomes the output for the application.

  • Redirect unwanted tomcat traffic?

    Hi,
    I'm running a site using tomcat as webserver (that is no apache front) and servlet container.
    A lot of requests to the site comes from referrer sites, generating traffic that we don't want on the site.
    Is there a way to redirect these requests to another site (outside of my own tomcat instance)?
    I'm thinking of using a filter, look at the remote host of the request, compare this to a list of blocked sites, and redirect the request to another site if I find a match.
    Good idea? Are there better ones?

    Technically a good approach. I'd redirect them back to the referrer however.

  • Problem with Tomcat 404 Redirects & Internet Explorer

    Hello All --
    I am running Tomcat 5.5.9 stand alone on a linux server. My default application is loading when you visit http://*IPAddress*/
    I have set up the standard <error-page> tags in my context web.xml, located in: TOMCAT-INSTALL/webapps/contextname/WEB-INF.
    Browsing to an invalid link through FireFox correctly displays my error page. However, browsing to the same invalid link through IE 6 displays the standard IE 404 Not Found Error message.
    The strange thing is, if I visit a correct page through IE, then go back and change it so it is incorrect, THEN IE sees my custom error page.
    For example, if I visit
    http://siteaddress.com/products.jsp?product_id=12345, the page loads correctly. If I change the address to
    http://siteaddress.com/products.js?product_id=12345, IE then sees my custom error.
    But if I enter the incorrect address right away in a new IE window, I receive the standard IE 404 error messaging.
    Could someone please explain why this is happening and what I can do to resolve the problem?
    Thank you in advance for your help!
    -- Chris

    Hi,
    I got this to work finally and documented it here:
    http://markashworth.objectis.net/Tutorial/tomcat404IE
    Hope this helps.
    Mark Ashworth

  • File Redirection in Tomcat 5.5

    I've got an application that reads from a collection of data in a
    directory outside the WEB-INF directory. I am able to read the data
    and use it to create an html stream to send to the user. This part is
    working well.
    Now, I'd like to include graphics (jpegs, for example), and when I
    build <img> elements that have links to the real location of the
    graphic (with file:///c:/wherever/my.jpg) they work in IE and fail in
    Firefox. My thought is that FireFox is asking Tomcat for the graphics
    file and it is trying to find it relative to the WEB-INF directory,
    and failing.
    Is there a way to spacify a mapping capability for images in Tomcat?
    Is there a way to have some servlet code to receive requests for an
    image, locate the file and pass it to the browser?
    Thanks.
    Dave Patterson

    graphic (with file:///c:/wherever/my.jpg) they work
    in IE and fail in
    Firefox. My thought is that FireFox is asking Tomcat
    for the graphics
    file and it is trying to find it relative to the
    WEB-INF directory,
    and failing.
    :-) , everything executes on the server and the end-results (HTML , Javascript) are sent back to the browsers.
    Server-side code is completely independent of client-side browsers. The browsers only see HTML, Javascript, CSS and other client-side code. The Java , and other server side code is not at all visible to browsers.
    Is there a way to spacify a mapping capability for
    images in Tomcat?
    Not sure about this, but you can check with Tomcat's user mailing list:
    http://tomcat.apache.org/lists.html

Maybe you are looking for

  • How to use existing form with UDO

    Hi I want to use Sales order form with a new UDO. Is it possible that one form work with More than one object. I want that when we click on User defined menu then same existing SAP form of Sales order will open with A new UDO( contains master and chi

  • OSB 11g - problem in workshop

    Hello, I have a problem with new OSB 11g in my workshop - it doesn't start properly - log: !ENTRY com.bea.workshop.wls.core 1 2000 2011-01-07 12:10:36.178 !MESSAGE Server watcher[Oracle WebLogic Server 11g v10.3 at localhost]:running Weblogic detecte

  • System Clean Install because of IP address issues

    HI, I just did a clean re-install of Snow Leopard as I had been having the self-assigned IP address issues that so many snow leopard users have been having. Before doing this I used time machine to make a backup of my HD on an external HD and synced

  • LDOMs with io resources allocation

    Hi all .. I've successfully made logical domain ldom0 on t5240 server, but one thing pains me .. i attached with ldo0 whole pci@500 bus, but devices connected to it is still visible from primary domain even if were removed during ldom configuration .

  • Wedding filmed in different codecs?

    I discovered a few problems after filming 3 weddings recently with 2 cameras. Once burned to DVD, it looked such bad quality. I know DVDs are not HD but still, it was really quite bad (especially on 50inch TV! it looked ok on 32inch.) I authored in i