GWTP Hiding the parameters from the URL - gwt-mvp

Is it possible to hide the parameters from the URL?
placeManager.revealPlace(new PlaceRequest("show").with("t", "e").with("x", "1"), true);
URL:
gwt.codesvr=127.0.0.1%3A9997#show;t=e;x=1
I want the URL to be gwt.codesvr=127.0.0.1%3A9997#show. Is this possible? or any other approach to do this?
I tried passing an event.. But the URL doesnt change in that case.
Thanks,
Pradeep

It is not possible in GWTP to hide parameters of Place(Request)s because a Place represents a state in the browser History and has to be (de)serializable into/from URL's.
I can't give you a good recommendation for a workaround because I don't know your architecture. If you like is dirty just use static fields which you initialize before revealing the place.

Related

Is there any difference for XPages urls using action=openDocument and action=readDocument?

Most times I've seen urls written to open an XPage in read-mode using action=openDocument, but occasionally, I've see action=readDocument used. Just curious if there are pros/cons in using one vs. the other.
I don't know of a difference. Honestly I never use these URL's anymore myself. So it's really not a big deal very likely.
Keep in mind, you don't need to use these at all of you don't want. You can pass your own parameter in the URL and then via SSJS access any parameters with the param object. You can also get the parameters in Java easily enough.
Just a thought.

Removing ids from url [duplicate]

Hey guys! Working on a new Cake app and wondering if there is anyway for me to remove the ID-in-URL routing from Cake. Perhaps by passing the ID in POST somehow? Having the ID passed in as a URL param just seems really shoddy and unsafe. Thanks!
"Shoddy"? It's standard practice and a perfectly fine solution to have ids in the URL. Look at the URL of your question:
http://stackoverflow.com/questions/4638262/removing-id-from-cakephp-url
^^^^^^^
id
Also, there's absolutely nothing unsafe about showing an id in a URL. It's just a number that doesn't mean anything. If a user can do something "bad" only by knowing this id, your app is broken and insecure, not the id-passing mechanism.
Trying to work around this scheme means working around the fundamental principle of the HTML protocol and opens up a whole new can of worms.
Some people prefer using slugs instead of primary key ids. This is the removing-id-from-cakephp-url part of the URL from this page. Take a look at the SluggableBehavior.
However, slugs can change. Hence, having the primary key in your URL is useful if you want to have a permalink. StackOverflow does both so that it can support both permalinking from other sites, as well as for SEO reasons. :)
Regarding security issues, I guess the other answers have already pointed out that there are other ways to make your application secure.
Why do you care? URL-s are optimized for SEO reasons, an ID won't matter if it's ain't too long. If the latter, consider using a shorter one with numbers and letters in them instead, it will be as difficult to guess as a long one with just numbers.
If you are not using GET and you do not supply the params in the URL, your users won't be able to copy-paste the location.

SEO optimized search results without JavaScript

I haven't found a direct answer for my question, so here it is:
I am trying to get my search results to be user and seo friendly. I believe it is a good idea to get rid of a couple of elements:
POST search should be avoided so the browser does not bug a user to
re-submmit the form if he goes back.
The question mark that appends the query string
The input name that goes with the form submmit if it is processed via an http GET (like ?search_input=cellphones)
So my question is a bit more: how do I turn a form submit into something like:
...mywebsite.com/search/my-search-term
...without using JavaScript to cause a redirect, but instead the form itself?
Do you guys tweak with .htaccess redirects to make your urls more "clickable", or just leave it be with the query string?
Just to be clear, the purpose of having the search user-optimized is clearly for people generating traffic through link distribution, and not to be indexed in a way or another by se's.
Thanks in advance!

What's the recommended approach for hierarchical URLs in Orchard?

I'd like to have a hierarchical URL structure in my site. Something on these lines:
tutorials
javascript
jquery
There should be a page at each level (tutorials, tutorials/javascript and tutorials/javascript/jquery). Obviously, using Taxonomies would help me organize my content in this manner, but how do I get Autoroute URLs generated for this scenario?
Bertrand Le Roy made a comment on this SO answer about using taxonomy terms as pages but it still doesn't seem to create the right URL structure for me. Am I missing something? Is there something specific I need to configure or enable to make this happen?
Are there any other approaches I can look at?
I was thinking of specifying the default route as something like {Content.Fields.Page.TaxonomyName}. It appears that this isn't really possible right now according to this bug report.
Here's an approach that seems to work without having to use taxonomies:
I added a Content Picker field called ParentPage to the Page content type and updated the Page's Autoroute default to
{Content.Fields.Page.ParentPage.Content.Path}/{Content.Slug}
Now in each page I get to pick what the parent page is and the URL is constructed how I expect it. From what I remember of working with WordPress, I think this is pretty close to how it allows you to do this parent page thing, too.

How can I make clean search urls?

If I have search that has a lot of different options, then url becomes very long and looks very bad. Is there anyway to make urls look better? Using POST to make search would keep urls clean, but people couldn't share search urls.
Try doing an advanced search with many options on Google: the URL is long and not especially human-readable. I really don't think that's a problem; I don't think many people read URLs often. If you expect people to share search results, then show a button on the search results page that will generate a tinyURL-style shortened URL for that particular query.
A POST is meant for something that changes server state (e.g. a database update) and really shouldn't be used for a search.
You can encode all of your search criteria into something like a hash and then have a single parameter in your querystring that has that value:
http://www.mysearch.com/query=2esd32d2csg3fasfdlkjSDDFdskjsEWFsDFFR39fdf
I'm not sure exactly how you'd encode everything, but it wouldn't be too difficult.
Do the different options actually need to be in the URL? For example, a quick search from my Firefox search window gives a URL like:
http://www.google.com/search?q=search&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
If I'm sending the link to anyone, I habitually cut off everything after q=search. Why not have the URL be the bare minimum that you need to send the link to someone (or bookmark), and make the rest as invisible POST variables?

Resources