What is the best way to maintain state in Java web apps?

Hi,
been looking at best way to maintain state between requests in JSP.
Ive been trying to use URL rewriting but been getting problems. I understand I can also achieve this using cookies.
Are there any other better ways of doing this.
I don�t know if the problem is with JBuilder4 or something in the Tomcat server?
Any suggestions would be appreciated.
thanks.

I think if you use JavaBeans that implements Serializable , it might maintain state (but not sure of this).
HttpSession is one option but , sessions have limitations - they timeout, they don't work when the page is cached by the browser and they don't work if Cookies are disabled in the browser.
Database is always an option, and there are two types of DBs , in-memory like HSQLDB etc , or the regular RDBMS like MySQL , Oracle etc.
If you only want to maintain state between HttpRequests, then use the request object which is implicit in JSPs.
I think your URL Encoding is not working most likely because you have disabled Cookies in your browser and that's why you see jsessionid.
If you enable Cookies in your browser then, the jsessionid should not appear.
There are other options I'm sure, but I'm only aware of the above at this time.... may be someone else might know more.

Similar Messages

  • What is the best way to maintain your Battery Life for Iphone 5 ?

    What is the best way to maintain your Battery Life for Iphone 5 ?

    hi,
    so what would you suggest to do here then. let it get to 50% then run the battery down and at say 5-%ish re-charge it fully.
    is there anything i could switch off on my phone to save battery power. ive taken off he location services apart from ym locate my iphone, stopped the fetch new data and set it to manaul . this is also the same for the icloud as well.more or less everything has been set to manual or set to off ??

  • Newbie: What is the best approach to integrate BO Enterprise into web app

    Hi
    1. I am very new to Business Objects and .Net. I need to know what's the best approach
    when intergrating bo into my web app i.e which sdk do i use?
    For now i want to provide very basic viewing functionality for the following reports :
    -> Crystal Reports
    -> Web Intellegence Reports
    -> PDF Reports
    2. Where do i find a standalone install for the Business Objects Enteprise XI .Net providers?
    I only managed to find the wssdk but i can't find the others. Business Objects Enteprise XI
    does not want to install on my machine (development) - installed fine on server, so i was hoping i could find a standalone install.

    To answer question one, you can use the Enterprise .NET SDK for each, though for viewing Webi documents it is much easier to use the opendocument method of URL reporting to view them.
    The Crystal Reports and PDF instances can be viewed easily using the SDK.
    Here is a link to the Developer Library:
    [http://devlibrary.businessobjects.com/]
    VB.NET XI Samples:
    [http://support.businessobjects.com/communityCS/FilesAndUpdates/bexi_vbnet_samples.zip.asp]
    C# XI Samples:
    [http://support.businessobjects.com/communityCS/FilesAndUpdates/bexi_csharp_samples.zip.asp]
    Other samples:
    [https://boc.sdn.sap.com/codesamples]
    I answered the provider question on your other thread.
    Good luck!
    Jason

  • What's the best way to maintain 2 libraries one lossless the other MP3?

    I'd like to have 2 music libraries one for home (lossless) and one for my iPhone (MP3). Not sure what's the best way to achieve this and maintain.

    To create or access a second (or more) library on a Mac, hold down the "Option" key (labelled ⌥ and/or alt) when launching iTunes: Using multiple iTunes libraries -Mac
    Note: You can only have one Library open at a time and iTunes will default to the last library opened if you don't use the keyboard command to choose one.

  • What is the best way to deploy application that uses web services?

    Hi all,
    I'm having some problems figuring out the best way to deploy our app now that we've switched over to using web services.
    I'm fairly new to Java and web services. From what I understand, JNLP and WebStart are methods to deploy Java clients to users and not for creating war files and the like.
    Here's a little background:
    We have a large PowerBuilder/Oracle application. The db consists of over 500 tables and the client consists of several thousand PB components. A user creates "transactions" which contain a series of "sub-transactions" within. Most of the data is collected and stored locally in the client in a series of datastores. When the "finalize" happens, the records are validated and sent to the database.
    We are in the process of moving each of the subtransactions (currently in the PB client) into subPROCESSES on a java project. We are using the JAX-WS framework to develop the web services in Netbeans. These web services aren't much more than remote xml as the messaging technology. For writing data back to the database, we are using the Java Persistence API to function outside of an EJB container but will shortly be migrating to the Glassfish application server to use several of the EJB container frameworks including the EntityManager.
    We haven't attempted any type of deployment and are unsure of where to start. Any suggestions would be so helpful and appreciated!
    Thanks!
    Edited by: doubleEspresso on Jan 10, 2008 8:06 AM

    >
    I'm fairly new to Java and web services. From what I understand, JNLP and WebStart are methods to deploy Java clients to users and not for creating war files and the like. >Correct, while Java Web Start has 'web' in the name, it has little if anything to do with web applications - certainly not providing much toward their installation. It is for launching rich client GUI based (AWT, Swing, SWT..) applications onto the end-user's desktop.
    There are some parts of JWS that might seem peripherally useful to the installation of a web-app., but it is really not a 'good fit'.
    >
    ..Any suggestions would be so helpful and appreciated!>You might try the forums for the 'web tier' APIs.
    <http://forum.java.sun.com/category.jspa?categoryID=20>
    Or perhaps the forum 'Java Technologies for Web Services' (under 'enterprise technologies')
    <http://forum.java.sun.com/forum.jspa?forumID=331>
    This one in 'BigAdmin' seems particularly relevant, 'Set up and Deploy'
    <http://forum.java.sun.com/forum.jspa?forumID=550>

  • What's the best way to get user testing of our app (we're based in the UK)

    Hi all.
    We've just developed our first app for Palm and would really like to get some feedback from Palm users (our app allows users to take photos and send them as real printed postcards. We'd be very happy to give users free postcards in exchange for feedback).
    The problem we have is that Palm users are pretty sparse in the UK. We've found that user testing with non-Palm users becomes handset testing rather than app testing. We have to teach them how to use Palm ("Where's the back button?") and so the testing mainly focuses on the particularities of Palm rather than our app. Plus, we don't benefit from the user being able to compare to other Palm apps.
    Any advice on the best way to get feedback from Palm users? Especially as they'll need to download the SDK and install our app using it in order to get it onto their phones.
    If any of the users of this forum are interested in giving the app a go and sending us feedback, I'd love to send you the IPK and then chat. Just send me an email using [email protected]
    Our app is available for Pixi+, Pre+ and Pre2.
     Thanks,
     Freddie.
    Post relates to: Pixi Plus p121ueu (SFR)

    Hello freddie:
    Welcome to the Palm Forums. Thank You for the offer. I highly suggest offering it up
    to our many enthusiasts on Twitter as a beta with the #webos hashtag or joining
    the Precentral.net community and list it in a topic there, homebrew beta. You would
    get better beta response if you Package your app and put it in an ipk to simplify
    the install.
    Hope that helps... Best of luck with your app!
    notimeoff

  • What is the best way to implement Carousel i.e. web part in a site page on office 365 site?

    We can implement the Carousel web part in many ways like content By Query Web Part , jquery (nivo) plugin or content search web part etc. But among these which one is the best way to implement to get best performance of the page?
    Thanks

    content search web part always provides best performance because it uses the search. only consideration you need to take is, it does not display the changes immediately and you need to wait for the incremental crawl to happen.
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • What is the best way to maintain models with common components?

    I work for a company that uses MatrixX/SystemBuild (v62.2) to build functional models of trains for use in driver training simulators.  We are currently in the early stages of a project in which we will need to build and maintain multiple train models which are likely to have some common components, but may have some significant differences.  Before we get too far into the modelling, I would like to come up with a decent method of maintaining the common components while keeping the differences separate.
    Ideally, I would like to find a way of quickly and easily determining the difference between two models and a way of conditionally pushing the differences from one model to another - in a similar way that one might diff two text files and conditionally copy the changes in one to another.
    I found a script (mx_62.2\sysbld\scripts\compare_catalogs.msc) that seems to accept two catalogs for comparison, outputing a difference log. However, I'm unsure how to use this as I don't know how to load two catalogs within the same instance of Xmath or how to assign a catalog to a variable for passing in to a function.  Does anyone know how to use this script?
    I am also thinking that it might be useful to be able to convert a catalog to an xml - I can probably write a script to do this, however I am wondering if there's anything freely available to do this.
    Does anyone have any other ideas?

    Let me first discuss about comparing models, then I'll talk about my ideas about modularization.
    Comparing models in anything before v8 is difficult. In v6 or v7, there's no way to load to separate files containing the same yet different superblocks. The tool scripts you found don't seem to be documented anywhere. Given the history of some of the things added into the product, I'm not surprised. Which means that it's useless to us. After looking at the scripts, it's difficult to figure out what the inputs to that script should be. You can launch multiple instances of xmath/sysbld and load the models separately, but that's about it.
    One suggestion if you have to compare models is to use the exportcatalog.msc script which will generate a text file containing the SBA commands to re-create the model. Do the same for both models then perform a text difference between the generated SBA commands in the generated files.
    Another possibility is to use SBA to get the details of each superblock (similar to exportXXX.msc scripts) into a form that's easier to compare between. I'm going to guess that some kind of generated SBA content is the expected input to the compare_catalogs, but I'm not sure.
    Now, within v8, we've created a hierarchical compare tool, that compares model files and shows differences. Copying changes between the compared models is a future enhancement. However, in the context of using v8, you could manually copying the changes between the models using the editor and/or project system as appropriate. Yes, in v8 you can separately load models containing the same named superblocks. Try it, I'll bet you'll like it and it will save you lots of time!
    Now, on to modularization. I'm not sure you're use of 'components' is the meaning of the Components feature in Sysbld or not. I'm going to assume that you are not using Components and you're generically using the term components as a set of logically related superblocks, or as I perfer to call them, a module.
    The only modularization tool you have in Sysbld is the file. What I mean here is that you are able to group sets of superblocks into separate savefiles (.sbd) then combine them to create a complete model. So, essentially, you will need to partition your model into modules and each module is a separate savefile. Then, you can choose which module (i.e. savefile) to load to construct a complete model.
    In v8, there's a project system specifically designed to make this kind of modularization within a project easy and straightforward to use and maintain. I'd suggest that you use v8.
    For previous versions, the best you can do is create xmath scripts for each complete model you need. The script will contain all of the steps needed to load the separate modules to make a complete model. Thus, you'd have a different script for each model. Also, becareful in v6,v7 that you'll have to manually manage which superblocks are part of which modules, it's tricky stuff. Again, you'll need to use scripts to help maintain this level of complexity in these versions of the Sysbld.
    Now, I do not want to recommend FileSuperBlocks, it's a legacy feature to deal with limited resources not applicable on today's machines.
    Also, I can't really recommend the the Component feature in Sysbld. It's really not a component, but more of an object, sort-of. And it sort-of gives you unique names and it sort-of gives you parameters. It will not help with the modularization I think you want so don't use these.
    In general, there are features within our latest v8 release of MATRIXx that will help you with all of your issues. If you can, upgrade!
    Bob Pizzi
    MATRIXx R&D

  • What is the best way to maintain my battery?

    What is the ideal charge cycle to be maintained?

    Here's what Apple says:
    http://www.apple.com/batteries/notebooks.html
    Now I'm gonna share a dirty little secret about all lithium batteries: Fact is, the biggest killers of these batteries are frequent full discharge/recharge cycles & heat. I'm well aware what Apple recommends, but I'm telling you that if you want your battery to last avoid discharging below 35 ~ 40% of capacity as much as possible & avoid heat. Every 3 ~ 4 months, it's OK to discharge to ~ 35% of capacity & then recharge to full. More often than that is not needed & will do more harm than good.
    The battery in the MacBook Pro I'm typing on right now is over 5 years old & still going strong...long past its rated life span. Don't know how much longer it will last, but if you keep in mind the biggest killers of these batteries, & act accordingly, yours will last as well.

  • What is the best way to maintain access control management - Weblogic, LDAP Server or EJB

    Hi All,
    I am involved in creating an application which maintains/manages
    the user privileges. The application is deployed in Weblogic6.1 and
    the users are stored in LDAP Server. The LDAP Server is located
    geographically away and I dont have rights to add or remove users. I
    have to write an application in EJB which will give different
    privileges to the users who are stored in LDAP Server. users may have
    different privileges of same Group.
    Please let me know how can I proceed. Whether I got to go with ACL's
    or Declarative Security in EJB component.
    Thanks in Advance...
    with regards,
    Gokul.

    Please let me know how can I proceed. Whether I got to go with ACL's
    or Declarative Security in EJB component.Couple of points.
    o You can not set ACL on EJB thru console. ( If you mean to do that) You can
    set the
    ACL on JNDI context on which you do a lookup.
    o If you do not want to set ACLs in JNDI context, your option is use
    declarative security
    in your ejb xml descriptors.
    I hope this answers your question.
    -utpal

  • What is the best way to handle Exception in Java?

    We are designing an application that will be developed using JSP + EJB .
    To deal with the exception part, we have thought about following solutions
    (1)All methods in EJB will be declare with throws clause, with the respect to the potential exceptions that can be thrown by method.
    We will catch only those exceptions, for which we can take alternative steps or further action when they occurred. All other exceptions will be thrown to the caller.
    (2)All JSP pages will have try/catch that catches exceptions thrown by EJB or by JSP code.
    (3)A common JSP file will be designated to handle Exception by setting isErrorPage property true and all JSP files are pointing to that particular file for exception handling.
    (4)Whenever any exception occurred in application, it will bubbled up and end user will get a common JSP page designed to handle exception.
    I am looking for the suggestions to improve this mechanism.
    Regards,
    Chetan

    The problem with the standard expection handling in a web environment is that all the potentially useful status information goes to the user, who probably won't make head nor tail of it. It also goes to the logs which someone might, or might not get arround to reading.
    What I do is to have a standard method called to deal with unanticipated exceptions and e-mail me a status report. This contains not just the extended stack trace (chasing any level of wrapped exception) but also details of the transaction being processed, including the user if known.
    Set up an e-mail alias with a list of people to receive these reports. Often you can have the problem fixed, and send the user an apologetic e-mail before they even get a complaint in.
    Create JSP tags to do this with any other per-page housekeeping.

  • What is the best way to control pdf display in web browser - the preferences settings don't seem to work?

    I'm able to display the pdf in the browser - but it comes in too large and the first page is a single and the second pages are a double page - and i don't want it to scroll. there must be soem script to control this?

    Browser Troubleshooting
    "Can't view PDF on the web" 
    http://helpx.adobe.com/acrobat/kb/cant-view-pdf-web.html 
    "Display PDF in browser"
    http://helpx.adobe.com/acrobat/using/display-pdf-browser-acrobat-xi.html 
    Be well...

  • HT2534 I have two class sets of iPad 2s and I would like to set up an iTunes account but don't want to put in my credit card information or individual students' information. What is the best way to set up class sets of iPads?

    I am a K-6 tech teacher and just recieved two classroom sets of iPads. I'm wondering what is the best way to set up iTunes so that apps may be downloaded. I do not want to put my personal information in and I do not want students to put in their informtion either. Teachers want to be able to download free apps and when the school purchases iTunes gift cards, they would like to be able to use them. What is the best way to go about this?
    Thank You!
    Jess

    Contact your IT person. They will help you with provisioning & setting up the iPads and getting apps on them and locking them down so students can only access certain settings and apps.
    I have asked that this post get moved to iPad Enterprise as it is more approriate forum for your question (even though it is about schools))
    Don't create an AppleID yourself and use it to put stuff onto the school iPads. You can't have more than 10 iPads to one iTunes account anyway.

  • What is the best way to partitioning Macbook Air 13" 2012 solid state drive

    What is the best way to partitioning Macbook Air 13" 2012 solid state drive.

    Tech,
    You don't provide enough information onto which anyone could reasonably formulate an answer.
    As mentioned, you don't indicate the circumstances that would warrant consideration of multiple partitions. Moreover, you also don't indoicate the size of the SSD in question.
    Like Fred said, ordinarily you leave it alone as one. Some people like to keep data and the OS/apps separate, but it is for specific reasons.

  • I am trying to rebuild my iPhoto library and noticed my backup contains aliases (pointers?) and not the actual file. What's the best way to rebuild my library?

    I am trying to rebuild my iPhoto library and noticed my backup contains aliases (pointers?) and not the actual file. What's the best way to rebuild my library?
    Facts:
    In moving to a new iMac, I copied the iPhoto library to an external HDD assuming that I would point the new iMac to the backed up iPhoto Library
    All worked fine when I pointed the new library but noticed that some folders contained aliases and not the original file. So when I attempt to open that photo it can't find it because the alias is pointing to another drive.
    I do have all original photos from a couple of external HDDs. In the folders titled, "Originals" (from older versions of iPhoto) and "Masters" (from current iPhoto)
    I'm thinking I can create a new folder and drop the original files and make that my new iPhoto library. Is there a better way to rebuild my library? I do not want to create any future aliases.
    Thanks in advance for any help!

    do you have a strongly recommended default "managed" library (the iPhoto preference to "copy imported items to the iPhoto library is in its checked state) or a referenced library - you have unchecked that option?
    It sounds like you have a referenced library and are now experiancing one of the very siginificant drawbacks of a referenced library and one of the many reasons they are strongly not recommended
    Also note that iPhoto '11 may use alises in the originals folder as part of the upgrade
    It is important that we understand exactly what you have and what is not sorking - what error messages you are getting
    You must NEVER make any changes of any sort to the structure of content of the iPhoto library - there are no user servicable parts in it  --  and you can not rebuild yoru librtary - only iPhoto ir iPhoto Library Manager - http://www.fatcatsoftware.com/iplm/ -  can rebuild a library unless you are a SQL programmer and understand the structure that iPhoto uses
    LN

Maybe you are looking for

  • How can i print from android 2.2 to photosmart c 4788 all in one printer

    Dear sir, my os is window xp, my HP photosmart C4788 all in one printer is unable to visible in my android phone with installed software HP eprint Home and biz. when requested to search wi fi enabled printer. This printer do not have facility of epri

  • Do BT cap IP Profile as a "fix" for unstable line

    I have a long rural line which seems to disconnect whenever there are heavy showers. In such conditions the router, BT2700HGV, will loose signal 2 or 3 times in the space of 5 minutes and usually re-connect at a lower speed, 3500 to below 2000 result

  • Problem With SAP GUI for HTML iView

    Hi All, I have created a transaction iView(SAP GUI for HTML) for the T code SE12, when I view the iview, it get loaded for the first time and if I log out and when i again login to the portal and view the transaction iview it is not getting loaded. I

  • When-mouse-leave

    db and dev 10g rel2 , hi all , i am trying to use when-mouse-leave for the first time , and i know that it fires when the mouse cursor leaves an item , and that is the functionality i want , i am trying to make an item invisible when i leave another

  • No sound when I try to play iTunes

    help ,baffling . the ringer or volume has vanished . my phone rings but will not play songs