Servlet redirection but maintain url in browser (make sense?!?)

Hi,
Would like to have a url like www.foo.com/careers
which will call a Servlet, passing in a parameter of "careers" so I know what content to display.
But instead of the url changing to www.foo.com/Servlet?page=careers in the browser (due to obj.con redirect), is there a way I can do this without the url changing from www.foo.com/careers, but still calls the relevant servlet and passes in the correct parameter?
Thanks

We were covering a very similar topic in this thread:
http://forum.java.sun.com/thread.jspa?threadID=5194280&tstart=10
Ultimately you would use the If structure with regular expressions to restart the request internally (the user-agent does not see this) with the full URI. Something like:
<If $uri =~ "/(.*)"
and $uri !~ "^/Servlet.*" >
NameTrans fn="restart" uri="/Servlet?page=$1"
</If>
This block appropriately placed in your obj.conf will internally restart the request with the original URI now used as the query string of the new request.
You could also use this instead:
<If not $internal
and $uri =~ "/(.*)" >
This will only perform the restart if the request being processed is determined to NOT be internally generated (e.g. an already restarted request).
Of course you should make sure that you application generates URLs that are appropriate to this URI space, not the canonical URI space. This configuration will also be pretty greedy with your URI space, preferring to rewrite everything:
/foobar/sub/dir/image.jpg
becomes
/Servlet?foobar/sub/dir/image.jpg
So you'll want to refine what options you're willing to match, and restrict the expression used here to be less inclusive.
For more information on this very nifty feature, see the docs at:
http://docs.sun.com/app/docs/doc/820-1062/6ncoqnpfh?a=view

Similar Messages

  • I want to fix slowness but the instructions to not make sense to me. It says click on menu---I ask, "What Menu?" Can someone do this for me--online?"

    I want to know how to speed up my Mozilla Firefox. It is very slow, but the instructions do not make sense to me. I do not know where the "menu" is to click on to reset to default. I have tried several things and none work. Thank you for your help.
    Vicki

    If you are talking about '''[https://support.mozilla.org/en-US/kb/reset-firefox-easily-fix-most-problems Resetting Firefox]''' {web link}
    This is a '''LAST RESORT ! !'''
    Start Firefox in Safe Mode]''' {web link}
    While you are in safe mode;
    Type '''about:preferences#advanced'''<Enter> in the address bar.
    Under '''Advanced,''' Select '''General.'''
    Look for and turn off '''Use Hardware Acceleration'''.
    Poke around safe web sites. Are there any problems?
    Then restart.

  • Went from windows 7 to 8 and now cannot play my previously bought songs.Tried all the recommendations about authorizing but doesn't make sense on win, 8

    Hi
    I changed over from windows 7 to windows 8 and now my previously bought songs will not play.Tried to follows all the intructions for authorising my computer but can't seem to make sense of them.The instructions don't seem to be for windows 8.Can somebody help?
    Thank You
    Robert

    Hello Robert,
    With the latest version of iTunes on Windows, the menu bars are hidden, and it sounds like yours need to be enabled before you can authorize your computer.  You can follow these steps to enable the menu bars:
    To keep the iTunes menus active, change the setting by selecting the Menu icon in the upper-left, and then selecting Show Menu Bar. Alternatively, you can press Control-B.
    You can find the full article here:
    iTunes: Turning on iTunes menus in Windows 8 and 7
    http://support.apple.com/kb/HT5610
    Once you have those turned on, you should be able to go to "Store>Authorize This Computer..." as outlined in this article:
    iTunes Store: About authorization and deauthorization
    http://support.apple.com/kb/HT1420
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Trying to make sense of div tags and css

    i know that i am a few years late here, but i am looking ot make the migration from using tables and switching over to div tags and css. i have watched a few tutorials on you tube and am trying to understand everything.
    please tell me if this is correct.  a div tag is basically a table and css is what is used to style that div tag to meet your needs, is this a correct assumption??
    if you go to my current site www.tankinz.com you can clearly see that the site is made up of tables, basically these boxes or tables contain a different item or package that a customer can click on and buy.  by using div tags and css would each of these boxes, or tables be their own div?
    sorry for sounding a bit moronic but i am trying to make sense of all of this.
    please help!

    Markup (html) contains elements, such as html, body, h1, h2, p, span, div and so forth. Hence a <div>-tag is part of an element; the other part being the </div>-tag.
    The element structure of many web sites is basically (using HTML5 element names)
    html
         head
         body
              header
              nav
              aside
              article
              footer
    These elements can be positioned and styled using style rules (css). Depending on the style rules, the above structure can take on many different styles, without ever touching the markup.
    Have a look here for a simple two-column layout using the same structure as above http://www.456bereastreet.com/lab/developing_with_web_standards/csslayout/2-col/

  • Does my DNG/RAW workflow make sense to you?

    Ive been shooting RAW from my Nikon D50, converting the files to DNG (3.3), opening them in Adobe Camera RAW (2.4) using PSCS, processing and saving in TIFF (often through a droplet). In the process I retain the original RAW .NEF file, create a universal DNG file, and finally create a lossless TIFF file.
    I do things this way because I want the supposedly more universal format of DNG, and Camera RAW 2.4 (which runs on CS) doesnt officially support the D50 .NEF file.
    I cant think of a reason to upgrade either the DNG converter or Camera RAW files. It appears that the new versions basically just support new cameras. Besides, to do so Id have to upgrade to CS3, and thats totally out of the question.
    I take about 2,500-3,000 shots a year not counting the ones I take for experimenting with different settings and such. I know some folk might think my process is time consuming and/or overkill to create and retain DNGs AND TIFFs, but Im thinking it just makes sense. Does this workflow make sense to anyone other than myself?
    Im going to post this in both the RAW and DNF forums to see who thinks what. Thanks for your opinions!

    Ive been hanging around the forums for a couple years now and have learned quite a bit from the others. Perhaps Ive helped others in the meantime. Im thinking thats the intent of the forum. Ive seen people blasted for not being as knowledgeable as some of the others and Ive always thought it's a shame. However, it appears Ive accidentally irritated folk by asking an opinion of something.
    I mentioned in the OP that I'll not be upgrading to CS3 or any other version of PS. So by default, and a point not picked up by some- the question is really in regard to the newer version of DNG and NOT Camera RAW.
    When I looked at the download page it appeared that the new version of DNG might somehow be connected to RAW. After all, they are in the same .ZIP file. Mr. Knoll was kind enough to point out that the newest version of DNG didnt require a PS upgrade. I should have figured that out myself as its a stand alone program, but by the way it was packaged Anyway, I downloaded the file, and unzipped it. Then ran DNG.
    It works fine. Just as the previous version. But what I was asking, and what some people took issue with, was if there were features that had been faulty with previous version, or perhaps previous versions did work with RAW formats from certain cameras. Things like that.
    I was thinking Mr. Knoll or another knowledgeable person might respond with Sure, Thomas, the newer version of DNG processes batch files much faster due to an improved bit-handling algorithm or Naw, the newer version of DNG is just compatible with more camera formats, so if the version you have works, no need to upgrade, or maybe even The newer version fixes a few minor issues with converting files over 9 MB in size.
    Instead, I was told that I wouldn't be asking such a preposterous, absurd question. if I had read the linked article. Well, prior to my second post, I did read it read it. Its a nicely written article with some great shots of the interface. It touts the new RAW as the best there is, and according to the author, Jeff Schewe, its well worth the price. But I also noticed it said nothing of the new version of DNG. Maybe thats because the article is titled About Camera RAW 4.1.
    Thank you, Mr. Knoll and G Sch.

  • HowTo make a servlet with PDF output to the browser

    A new one goes here !
    How do I make a Servlet which functions like the rwservlet, and pushes a PDF output to the clientbrowser ?
    Is there any sample code that uses rwclient or others to produce a response ?
    Thanks anyone.

    Requests to the ReportsServer to run a job and return PDF is simply submitting a URL. You could easily write a servlet to submit a URL and stream the results back to the browser. However, this is a more generic requirement not really involving Reports (apart from the fact that you're calling it via the URL).
    For more information on creating a servlet to submit a URL and get the results, you might like to cross-post to the JDeveloper forum.

  • Redirecting to another url when seesion expires... or on closing browser wi

    is it possible in servlet/jsp using tomcat to redirect to another URL so that i can delete my objects that are stored in ServletContext ?
    i want to redirect when the session get expire or when a user close its window ..
    is it possible using javascript ?
    if any info Plz mail at gmail ..[email protected]

    public class sessionManager implements HttpSessionListener {
         public void sessionCreated(HttpSessionEvent se) {
         public void sessionDestroyed(HttpSessionEvent se) {
    In this class for the sessionDestroyed() function i want to write RequestDispatcher .. so that i can redirect or forward my request to another URL so that i can delete my object that r present in ServletContext.
    because for requestDispatcher i need to implement HttpServlet
    which overrides service method ( doGet()/doPost()).which receives HttpServletRequest/HttpServletResponse object ...
    Plz let me know if possible .... the main thing is that i want to go to that particular URL for delting my objects
    any Plz let me know

  • How to show a nice URL in Browser URL navigator?

    How to show a nice URL in Browser URL navigator?
    Hello
    Arquitecture:
    Internet --- Machine1 (Apache like Proxy Reverse and rewrite) --- MAchine2 (GLASSFISH-APEX LISTENER 2.0.1) --- DATABASE
    That application will be like a directory of products, we need a nice indexation inside google, yahoo, etc...
    We want to build an application with APEX, with a nice custom URL. like http:\\domain\pagina1\pagina2\pagina3
    Limitations:
    * We can not use frame
    Actually, We obtained that when we write in a browsers URL domain "the domain" redirect to "http://domain/apex/f?p=600", and that appear in "browser url" but we want to know if is posible to change that without use frames.
    Thanks.

    Interesting Morten states that "You can use Apache with mod_rewrite to set up mapping between REST-style URLs to your Apex pages...", I've seen no working examples of how to do this with Apache because mod_rewrite is very limited in it's ability to process the query string part of the URL, with all the APEX stuff we need to refer to.
    Morten if you are reading this, what's the secret man?

  • No redirection to different url upon http connections limit exceeded

    Hi,
    As of Standalone OC4j 10.1.2, if you want messages to be redirected to a different URL when the maximum connections limit is reached, you would include the HTTP redirect URL to max-http-connections tag inside server.xml.
    <max-http-connections max-connections-queue-timeout="120" socket-backlog="50"
    value="100">http://optional.redirect.url/page.jsp</max-http-connections>
    I have a standalone OC4j 10.1.3, and would like to be able to redirect to different URL when maximum connections limit is reached but the above max-http-connections does not work and I am not redirected to different URL when maximum connectionns limit is reached. I read user guide of OC4j 10.1.3 and there is no mentioning of max-http-connections at all. In there, they talk about limiting concurrency via http thread pool but there is no discussion as to the mechanism of redirecting users to a different URL where I can display a user friendly message to say "Server is busy, please try again later..." instead of browser display a message "Page cannot be displayed"..
    Please advice,
    Thanks

    Any thoughts on above issue ? please help.
    thanks
    Sam

  • I can't be the first person to have thought about this but...would n't it be nice if instead of having to naviagte with your mouse to go back a page in Safari, wouldn't it make sense to just have a keyboard stroke to do that?

    I can't be the first person to have thought about this but...wouldn't it be nice if instead of having to naviagte with your mouse to go back a page in Safari, or any browser,  wouldn't it make sense to just have a keyboard stroke to do that? It comes to mind as I sit here with my hand bandaged in a splint after surgery.

    Try Command + [
    Allan

  • I want to allow redirects but not auto-reloading

    I'm running Yosemite on a Mac Air, with fully-updated everything.
    I'd like to stop pages reloading without my permission. This is usually an issue for me on news sites.
    In FF preferences, the option to allow or disallow auto-reloading is tied to the option to redirect. I can allow or disallow both, but not allow one and not the other.
    The net effect is, my news sites aren't automatically refreshing (yay), but other sites get stuck when a page redirect comes up. I play Scrabble online; now I have to manually allow a redirect with every play. Same with following Twitter links.
    Is there some way to kill off the auto-reloads while still allowing redirects? Maybe a whitelist for redirects, as a secondary option?
    Thanks!

    I do not know if the browser can tell the difference because it depends on the DNS server to give redirect requests back to the browser. Actually it does, 301 or 302 vs new http get request.... anyway:
    I found this add on: [https://addons.mozilla.org/en-us/firefox/addon/refreshblocker/ Refresh Blocker] and [https://addons.mozilla.org/en-US/firefox/addon/noredirect/?src=search No Redirect] which both let you control what sites to allow if there are only a few sites.
    This would only be a temporary work around however.

  • Need to invoke a process from a column link and then redirect to a url

    Is it possible to invoke a process from a column link then redirect to a url
    I want to invoke a process that has a pl sql block of code which will do some table inserts and then redirect the user to an external url.
    Any help would be appreciated.

    Howdy Scott,
    I thought this might help me but I've got a dynamic form with apex_application.g_f01(i) items on it ie tabular form. How can I take the value of these arrays with me to the temporary page with the onload process?
    Thanks
    Gary

  • OIM custom web page developed shows up on copy pasting the URL in browser

    Hi experts,
    I am facing this weird issue. I have developed a custom web page to generate password after adding custom menu item in OIM.
    The web page shows up on copy pasting the URL in browser. Only System admins after loggin in should get this menu item and page after clicking on it.
    http://xxxx:7778/xlWebApp/generatePassword.do
    But any1 can access this page currently. I have changed the action class to check for valid session,so clicking reset doesnt trigger the code.
    So atleast the functionality is protected.
    But the page still shows up on copy pasting the URL. How do i prevent this from happening ??
    Any suggestions and pointers would be appreciated.
    Regards,
    Confused developer.

    My action class does extend tcAction class.
    Does my action class need initialisation code i.e. below lines of code ??
                   ConfigurationClient.ComplexSetting config = ConfigurationClient
                             .getComplexSettingByPath("Discovery.CoreServer");
                   final Hashtable env = config.getAllSettings();
                   tcSignatureMessage moSignature = tcCryptoUtil.sign("xelsysadm",
                             "PrivateKey");
                   ioUtilityFactory = new tcUtilityFactory(env, moSignature);
    1 more question :
    Should i check for valid HttpSession() in the execute function() of the action class ??
    Can you share code for a sample custom action class please ??
    Thanks in advance.

  • How to hide/disable the Real URL on Browser

    Hi
    We are using Sun one Application server 7 on solaris.We are using JSP and Servlet.
    Directory listing pattern is ocurring as www.myapp.com/rite/pre/information.jsp in address bar of browser.And Want to dispaly only www.myapp.com in address bar instead of www.myapp.com/rite/pre/information.jsp
    Is it possible we can disable/hide the directory listing pattern from url in browser?
    please help me out.share the ideas.
    thanks
    lalit

    I thought this is realetd to the security feature that's why I posted here and nothing else.
    How to configure server to map www.myapp.com/rite/pre/information.jsp to www.myapp.com?
    what are steps fro that?
    please have look.

  • Firefox is not redirecting to given url it is in ideal stage

    firefox is not redirecting to given url it is in ideal stage

    You can check for problems with preferences and try to rename or delete the prefs.js file and possible numbered prefs-##.js files and a possible user.js file to reset all prefs to the default values.
    *http://kb.mozillazine.org/Preferences_not_saved
    *http://kb.mozillazine.org/Resetting_preferences
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    You can try to reset Firefox.
    *https://support.mozilla.org/kb/reset-firefox-easily-fix-most-problems
    If you reset Firefox then a new profile is created and some of your data (bookmarks, passwords, cookies, form data) is automatically imported and your current profile will be moved to the desktop (Old Firefox Data).
    You can recover more data from the old profile (be cautious with doing that).
    *https://support.mozilla.org/kb/Recovering+important+data+from+an+old+profile
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

Maybe you are looking for