How the page should redirect when we click a link using sessions

Hi Friends,
I have two links namely Gujarati and English in the page. before logon to the application, when i click the Gujarati link, the total content of the page should change to Gujarati and for english as same..How to do this using sessions and Internationalization(i18n).
It can be easy if anybody is using Property files and resourcebundle.
Thank you..

I will give u a very simple example of using session here.
Lets say you have 2 links in your HTML or JSP page: Gujarati | English
In you nextPage.jsp, you need to do the following:
<%@ page session="true" %>
By using page directive with session attribute to true will make HTTPSession implicit object available with you in your JSP.
Now you can save your request parameter lang to this session for further identification of user's selection for the language.
This is how it can be add user selected language into sessions in JSP:
<%
session.setAttribute("Language", request.getParameter("lang"));
%>
To retrieve this value for further usage, you can use the following:
<%
String lang = (String)session.getAttribute("Language");
%>
If you are using servlet instead of JSP, you can handle the same by having following lines of code in your servlet:
To set a value or object in the session:
HttpSession session = request.getSession();
request.setAttribute("Language", request.getParameter("lang"));
to retrieve a value or object from the session:
HttpSession session = request.getSession();
String language = (String)request.getAttribute("Language");
I hope this helps to solve your problem for having selected language using sessions. Once you know which language the user has selected you can use internationalization to convert your pages to other languages.
Choicest Regards
Amit Singh Rathore

Similar Messages

  • Redirects when I click a link, but works if I type the URL

    I have a MacBook with Tiger and Safari. All currently updated. I have an email with a link to the person's homepage. When I click it, it goes to his old homepage, which used to be listed in his emails. If I type the URL in the link, it goes to the new page, as it should. It doesn't do this on any of my other computers (two macs, two pcs).
    Can't be a host file, or typing the URL wouldn't help.
    I used Onyx to clean cache, including system cache. Cleaned cache from Safari. Deleted the Safari cache from my libray/users/caches/ folder. Restarted, rebooted. Deleted cookies, deleted history.
    What could be doing this? More perplexing, how would it know what link this guy USED to use in his emails, but no longer does?
    Spooky...
    MacBook   Windows XP   Tiger, of course

    Interesting suggestion. I installed PithHelmet (Pretty cool, by the way) and told it to remove the referrer headers. No joy. Still doing the redirect. You are on to something as to how it's doing it, though. I'm using Yahoo mail. If I log into another mail account using this machine, and click this link in a message, it goes to the right page. So, the link is only broken on my machined, while logged into Yahoo mail AS ME.
    If it's any more help, the correct site is an iWeb page. The old one it keeps sending me to instead is on geocities.

  • How do I stop extra instances of my Firefox home page from opening when I click on links?

    Frequently, when I click on a link in an email or on a web page, and Firefox is not yet running, not only does that linked web page open, but also an extra instance of my home page opens. I would like to prevent this from happening.

    I asked the same question on Yahoo! Answers, and I was advised to reinstall Firefox, which I have just done (with version 3.6.8). The problem seems to be solved. Prior to doing this, I attempted to uninstall my previous version, but Control Panel wouldn't let me do this, nor would Windows Explorer allow me to send the whole Mozilla Firefox folder to the Recycle Bin. I went to Plan C, which was to delete all the subfolders in the main folder, followed by the leftover files, and finally empty the Recycle bin. Then I used Internet Explorer to download the newer version of Firefox, and installed it. No more extra home pages, so far.

  • How do I set the page that opens when I click to open a new tab?

    Whenever I click to open a new tab I get the Yahoo search page. I do not want it. How do I change it?

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • I recently upgraded to iOS 7.0.  When I open Safari to a blank page, a small "Settings" icon appears against the white background.  When I click on it, it opens  a link to a web page that is not among my other bookmarks.  How can I get rid of it?

    I recently upgraded to iOS 7.0.  When I open Safari to a blank page, a small "Settings" icon appears against the white background.  When I click on it, it opens  a link to a web page that is not among my other bookmarks.  How can I get rid of it?

    Leliforever, cheek you list of installed add-ons, the Ask toolbar can be installed without the users knowledge.
    For checking other extensions that may cause this, follow the procedure in this link - https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • I have installed Elements 13 on my Mac but can't see how to open it. When I click on the disk icon it takes me to an information page that gives no information about opening Elements 13.

    I have installed Elements 13 on my Mac but can't see how to open it. When I click on the disk icon on the desktop it takes me to an information page that gives no information about opening Elements 13. How do I open the software so that it can be used?

    Unfortunately, when I open applications, adobe photoshop elements 13 folder does not appear in the adobe folder. It appears as a disk on the desktop, only.

  • I cant find an app that should be on that should be on the app store, and when I click on the website (sky poker) and I click on "downland thee app on the app store" only a white page appear on app store.

    I cant find an app that should be on that should be on the app store, and when I click on the website (sky poker) and I click on "downland thee app on the app store" only a white page appear on app store.

    Well, I went to a Sky Poker website and find it it seems to be something related to playing poker online and the currency is measured in pounds. I do not see anywhere on the website where it tells me that I can download an iPhone app, and when I search the App Store (US) I do not see a listing their either. You may need to send their support a question/email and ask if they have something in the app store and what the name of it is.

  • Why is it when safari is minimized on my iPhone it's stuck on a certain pages thumbnail but when I click on it the correct page shows up?

    Why is it when safari is minimized on my iPhone it's stuck on a certain pages thumbnail but when I click on it the correct page shows up?

    It doesn't really matter whether I am talking to Apple or not (and I'm sure they monitor these comments), I want everyone to know how bad this new iphone 4s is, and all of it's problems.
    Apple have already launched an upgrade to the software - it obviously did not help, as many around the world would concur.
    As far as being patient and waiting for another "update in the works" is concerned, it is just not satisfactory. This is not a cheap phone, and those who are experiencing these problems, should not have to be paying a substantial amount of money, for a very smart phone, that obviously, has some serious problems.

  • When I click email links on firefox, it won't open my AOL email client to continue, I get "The file may not be supported by AOL, AOL will try to open it as a text file if you choose to continue" how to fix?

    When I click email links on firefox, it opens AOL, but comes up like this.. "The file may not be supported by AOL, AOL will try to open it as a text file if you choose to continue" how to fix? and yeah, I know, ditch AOL and all that good stuff, but I have so many things tied into my email address that it's not in the cards atm..
    Thanks!
    *Chris

    That file might have moved to a different location on the server. I think you'll need to check with RefWorks support or your local IT department on why the install page links do not work.

  • When I try to open the Iphoto it keeps on asking for the software update but when I click on the software update tab, it says that all updates are up to date. I still cant open the Iphoto, what should I do?

    When I try to open the iphoto it keeps on asking for the software update, but when I click on the software update it says that all the software in the computer are up to date. I still cant open the iphoto, what should I do?

    How old is your Mac? If it's very recent you need to update via the App Store
    If you purchased at the App Store you need to update via the App Store
    Otherwise you update via Softare Update
    If you have moved iPhoto from the default location (i.e. into a Folder) then the updater won't find it. Move it back.
    If you have renamed iPhoto, the updater won't find it. Change it back.
    Regards
    TD

  • When i click a link on (facebook, google, yahoo, etc) it sends me back to my home page. It has done this at least 5 times only starting yesterday the 29th, one of numerous issues arrisen since the newest 4.0 security update.

    This issues persists mainly on my two most frequently visited sites, Facebook, and deviant art. When I click any random link on any random page, the link would send me back to my home page, as if i had clicked the back button when i hadnt. I cant specify what links specifically, but it has done it twice on my facebook home page, once on a google search and several times on Deviant Art. On Deviant Art, I was several pages into the site when i clicked on a users gallery and it sent me right back to google, the back button wasnt active, but the forward button was, when i clicked the FORWARD button it went right back to my last page, just as if i has hit BACK. This problem has only been apparent for the last 2 days since the 29th, and only after i installed the last security update provided by the firefox team. seems like a bad coding error that mixes up and redirects addresses, that would be my guess.

    adkennon wrote:
    And maybe you don't talk to too many people but I've been on many forums on different websites where people have had similar problems and a lot of people in the store were having battery problems where they were draining too fast. What I learned is that all the people who did not download the updates are good. There phone is working the same. The people who have, they're having battery problems
    I have downloaded every update and my battery life is better than any previous iPhone I have ever owned. I see posts from hundreds of people every day, and this is not a commonly reported problem. While there are a few random reports of battery problems, it is no more than I have seen for any other model or any other version of iOS in almost 8 years. Usually problems of rapid battery drain can be traced to bad apps (FaceBook is the worst offender) or corrupt data being synced from iCloud or other sources (gmail, Windows Live, Yahoo, etc).
    The simple test is to restore the phone as New. Do not create any email accounts. Do not install any apps. Do not enable FaceTime or iMessage. Do not enable Twitter or any other social networking app. Use it for a day and check the battery usage. You will find that it is working well.
    And also see this: http://www.overthought.org/blog/2014/the-ultimate-guide-to-solving-ios-battery-d rain. It is the best treatise I have seen on the subject of battery usage.

  • How can I get the page to curl when turning to the next page in iBooks author?

    How can I get the page to curl when turning to the next page in iBooks author?

    I don't think you can. If you need that effect, you should use ePub (that can be authored via Pages) not iBA.
    I hope Apple give us the option in the future though.

  • When adding a time to an event in the calender in the new ios7 the page scrolls up when trying to adjust the time .How do I finely adjust the time without the page moving upwards?

    When entering an event in the calender the page scrolls up when trying to enter and adjust the time,how do you adjust thge time upwards without moving the page?

    I see no direct connection.. a printer and the computer setup for internet are not related.
    But it sounds like the router in the wife's office is now in the wrong mode..
    If you have an existing main router replace the second router for a switch .. that is the easy way.
    Otherwise you need to bridge the router if it has that option.. most do not. Or use wan bypass.. where you turn off the dhcp server in the router and fix its ip to match the range of the main router.. this is the hassle of using router as a switch.
    BUT I am making a huge number of assumptions.
    What I need is the full network layout.. a quick picture would help.
    I need main modem.. main router.. (maybe same box or different).. make model and current IP address and how dhcp is setup.
    I need secondary router.. if that is what it is, IP and settings.
    I want the printer type and model. How it is connected.
    BTW I much prefer to see a network printer plugged into the network rather than usb.. it is only a matter of sorting the IP settings and driver pointing to the network rather than local.
    Or you should think of it as a broken washing machine and call the technician.. who could fix the whole lot in an hour.

  • Why do I get the "iwork discontinued" message when I click on the share feature in pages?

    Why do I get the "iwork discontinued" message when I click on the share feature in pages?

    If you are using an older version of iWorks, the sharing was, I understand discontinued in July 2012.
    New versions of the iWorks suite, Pages etc now have the sharing option, introduced earlier this year.

  • I can no longer send a Pages document.  When I click Share my Send Via Email is grayed out.  When I click on pdf or any format the pull down screen disappears and nothing happens.  Why?  I am using an iMac with Mountain Lion.

    I can no longer email a Pages document.  When I click Share my Share Via Email is grayed out.  If I click pdf the window disappears and nothing happens.  Any ideas?

    Do you have the application Mail as the default mail application?

Maybe you are looking for

  • UDO WITH MORE THAN ONE CHILD TABLE

    Hello There. Can I handle more than one child table for a master table by code? if I can, how do I create this udo, I have tryed the following code, but it takes the last child table ("jobs7") If oUserObjectMD.GetByKey("Jbs_UO") = 0 Then            

  • IChat Audio/Video not happening

    Three differnt people with 3 different setups trying to do an audio chat: John: MacBook(2.0Ghz, Leopard), connected via AirportExpress, using an AIM account Anne: MacBook(2.4Ghz, Snow Leopard), connected via a 3G USB Modem, using a .Mac account Mark:

  • Default Search is Case-sensitive

    I go to contributor mode and try to choose an image. A window that contains alll the image content items show up. I type the name of the content item (an image) in the small search text box on the top right side of the window. It seems that when I en

  • IPod mini froze?

    As of two days ago, my iPod mini will not work properly. Last night, I tried to turn it on, but it wouldn't respond. I finally got the Apple icon to come up after trying to reset it, but then I got the folder with the exclamation mark. When I plug it

  • Airport extreme mac and Windows

    Since a couple of days, my macs cannot connect to internet via my airport extreme base station anymore, but my laptop under windows still access internet through this same station. This did happen fter the last Apple security update. Anyone any idea?