Redirecting form to current browser url (ATG) - redirect

I have a form which is included on all the pages of our website. The dsp:form action attribute is same as the current page url. This works fine for most of our pages but fails when a user submits the form on a page where browser shows a seo friendly url.
For example when a user submits the form on one of our product pages www.mysite.com/products/prdName the page refreshes and redirects user to www.mysite.com/prodSpec/index.jsp
How can i keep user on the same browser url on form sumission?
TIA

Have you considered using therein property value /OriginatingRequest.requestURI as your successUrl value?
OriginatingRequest is a request-scoped component that represents the current HTTP request (specifically, the instance of DynamoHTTPRequest)

Related

Elementor form not redirects after submit when using params in url #?ref=abandmail5

I have an elementor page containing a form with submit button and redirect after submitting. I have an issue with page url with params that I get from mail responder service. For example I get a link https://www.mysite#?ref123&name=abc. The issue that form submit and redirect does not work on a page with such url. Popus also not working with such urls. I assume that the problem is with a fragment identifier. Is it possible that it interferes with Ajax methods and what solution for this?

Pass reference id from url bar to other internal pages

I am compiling a lead generation landing page and, in the form I have inserted a hidden field which collect whatever is written in the url bar after
"?rel=".
This is done in order to track where the leads come from (Facebook ads, direct linking etc).
To be more clear if this is the url: www.mywebsite.com/form.html?rel=fbads
the hidden field will be fill with "fbads" and this is working.
In the landing page I have a link to another page with more details and in this webpage I have the same form.
My idea is to run campaings on the first page with the rel link, but then if the user clicks on the link and go to the detailed page (and then compile the form from there), I am losing the rel field.
How can I pass the rel field to the url of the second page?
Thanks
You may refer the this stackoverflow page. Once the HTTP GET request comes, traverse in HTTP headers in your controller and look for Referer field but it is not always set and the client can change the header value. May be using google analytics is the better option.
If you just want to know that whether if they came to your form page from your landing page or not, you may add fix HTTP URL parameter prior to HTTP redirect.
If you save your rel in a variable, you can add it on your link to detailed page, for example in case of =fbads just once variable is set up, add it: <a href="http://myDetailedPage.com/detailed/?=<?php $rel;?>"</a>

Landing page validation in protractor

I have a website with user login(https). When I do validation for each landing page when navigating from the home page, there is a page load function checks both the elements in the page and the landing page URL.
Since it is a user based page, the URL is often dynamic, and it sends out the encrypted values after the page title (https://website/pageTitle/dynamicEncryptedValue).
As I follow the page object model for testings, I have to mention the URL in every landing page.
Any idea how I can keep the URL a dynamic value and validate irrespective of the user detail.
if your website pageTitle are constant and only the dynamicEncryptedValue will be dynamic. Hope the below way of validation helps you
expect(browser.getCurrentUrl()).toContain('https://website/pageTitle/')
The above code validates only the constant values and omits the dynamic value in the URL.
Hope it helps you!!

JSF 2 redirect to first page on back button or URL copy paste (no Authentication involved)

I have a JSF 2.0 application that is used for creating accounts using Self Registration. On the first page, there are fields like name, email, uid etc. Typical to any registration, we show the confirmation page, (other custom pages as well in between) and the final success page. Each page is rendered in JSF using the faces-redirect=true so there are 3-4 pages(facelets) in the entire process. In this application, I use a SessionScoped backing bean to show the middle pages/confirmation page/final page etc. After the registration is complete, I clear the SessionScope bean from session and invalidate the session.
The problem is:
The confirmation page/middle page etc. show the User details that the User entered from the first page(using the EL from the backing bean: #sessionBean.firstName etc.). So, if the User enters this URL in the browser directly (host/appName/confirmationPage.xhtml), the page loads with blank values (as the User did not go to the first page directly). Also, after the registration is complete, if the User clicks on the back button blank values show up (no-cache is explicitly set in the filter class, so cache is not used here which is the correct behavior)
How do I force the User to go to the first page if the firstName etc. is not present. i.e. when the User lands up on a page, make sure that User landed on this page only through the first page in this session?
Should a filter class be used? Or should a prerenderview event be used to check for blank values and redirect them to the first page? There is no "User Login" here as there is no authentication. I believe this is a common use-case and I would like to know if there is any best practice in JSF

on wicket's continueToOriginalDestination() method

what is the link between backbutton and continueToOriginalDestination(). method.
how to keep url saved for continueToOriginalDestination() method while clcking browsers back button.
continueToOriginalDestination() is used when a request was (temporarily) redirected to an intercepting page, for example a login page. When a user requests a secured page but is not yet authenticated, the security framework that hooks into wicket (auth-roles, shiro, swarm/wasp) will present the user with a login page, and store the original URL. When the user has authenticated, you can call continueToOriginalDestination and Wicket will process the original request, displaying the requested secured page.
Not only security frameworks can use this, you can do it yourself by throwing a RestartResponseAtInterceptPage exception.
The back button has nothing to do with this, nor does it have any affect on the processing of the original destination page. Wicket keeps storing the original destination until a new one is set, or until continueToOriginalDestination has been called.
continueToOriginalDestination returns true when there was a page to go to, and false when the user landed on the intercept page directly (e.g. guessing the login page URL or clicking on a link pointing to the login page).