Friday, June 6, 2014

Re: In order to make the url bookmarkable, sometimes we need long parameters but IE max url length is only about 2000, How to deal with it?

Sorry i did not state my app clearly, but generally it likes this:

let imagine this app, u have a page that have lot of checkboxes & users may click 5,10 or more checkboxes randomly, & last time when user visit the page they should be able to see exactly the number checkboxed that was checked in the exact locations that they did last time. For example, user select 10 checkboxes in an url & 10 years later if they visit the same url they still can be able to see 10 checkboxed were checked at the exact positions that the user set 10 years ago. There is no way to use session or state objects in the situation like that.

If we store the parameters in the cookies but the cookies won't last forever? 
or store all these checkbox info into DB?--> then each time user checks a checkbox then we need to update DB??  besides it can make the DB biggers & slower for such a simple task.

Can u find a soluution that we don't need to store into DB but still can handle that situation since it is not the most critical function so we should not put too much resource for it?



On Friday, June 6, 2014 7:29:51 PM UTC+10, Thomas Broyer wrote:


On Friday, June 6, 2014 6:16:23 AM UTC+2, Tom wrote:
we need a lot of parameter for our gwt app for handling the history, if the url length is limited then the GWT history function also got limited, 

Be careful not to confuse "state" and "history": if you have that many parameters, I suppose that you're storing not only the current state of the "screen" but also the steps that led to there (e.g. which was the previous screen so there can be a "return to X" button). IMO, you shouldn't store those in the URL but just keep them in memory in your app, and choose a default behavior (choose a default for the "return to X" button, or not displaying that button at all) when you load the URL "fresh".
You could possibly store some state in cookies or localStorage, but then you run the risk that this state is not in sync with the URL that's being loaded, and will have to cope with it.
 
can we have other solution like storing the url parameter in Database?

Hey you can always send all the parameters to your server to get a "short URL" (store data in DB and get an identifier in exchange, and use that identifier in the URL), but that also means you'll need to ask the server for the parameters corresponding to the ID form the URL, and decide on when to "expire" that data to free some DB/disk space on the server.

I don't know your application, but I think if you have that many parameters, then you have a design issue to begin with.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment