This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Advice Request: using interceptor to bounce user back to

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
functionality required is that I have an opening page whereby the user should select what subdomain of a site they would like to visit. this is appended as a request parameter as in:


My intention is that an interceptor (DomainInterceptor) which I am trying to code will always investigate every request such that the user will be redirected back to the select domain page if the domain variable is not found in either the request parameter (used initially, e.g. action?domain=3043204), a stored cookie (used for long term and user returns).

My problem is that I cant get the interceptor to locate the request parameter. was wondering if anyone had any suggestions about which way to go. This is a standard functionality, if you goto the UPS.com page for the first time you'll see exactly what I want to do. The issue is that after the user selects their "subdomain" this cookie/parameter will be required in the rest of the web-application to tell it what "domain specific" content to load for each page.

Note: This interceptor is configured to execute after the defaultStack


similar examples:
https://coderanch.com/t/445369/Struts/Application-Frameworks/Setting-request-parameter-from-interceptor#1982373
http://www.vitarara.org/cms/struts_2_cookbook/creating_a_login_interceptor
http://www.java2s.com/Code/Java/EJB3/GetSetParametersInInvocationContext.htm
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you accessing the request? AFAIK this works without issue. As an example, see the "servletConfig" interceptor (or whatever it's called) that sets the request parameters into the action.
 
All of the following truths are shameless lies. But what about this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic