java


Struts2 : Trimming String properties after Action invoke/execute


My requirement in my Struts Application is that, I want to trim all String properties of Value Stack After Action executes, my String properties contains lots of white-spaces
Till now I have tried this using Interceptor after referring http://stackoverflow.com/a/12410881/3425489
First trying to get all String Properties, but not able to get them all, not able to get String properties from Model
this is my Interceptor code snippet
public class StringTrimmingInterceptor extends AbstractInterceptor {
private static final long serialVersionUID = 1L;
#Override
public String intercept(ActionInvocation actionInvocation) throws Exception {
String result = actionInvocation.invoke();
Map<String, Object> parameters = actionInvocation.getInvocationContext().getParameters();
for (Map.Entry<String, Object> entry : parameters.entrySet()) {
System.out.println(" Type : " - "+( entry.getValue() instanceof String []) +" - "+entry.getKey()+" - "+entry.getValue() );
}
return result;
}
}
Question: How do I Trim all Strings from Value stack ?
Right now I'm trimming String properties of Model in my getters

Related Links

Android - Realm How to get value
Static body bridging two other static bodies
add new line to file when appending
Convert/alter edittext input for use in another calculation.
How to exit from forEach if some condition matches in java 8
How to step into or step over code while debugging application in Android Studio
How to write Lambda expression into method references?
How to format or truncate a scientific notation Double value to three decimal places without changing the exponent part in java
Does not print, loop and array error
unable to start activity, android.content.res.Resources$NotFoundException: String resource ID #0x0 [duplicate]
Run Kurento application
Send e-mail with Java using hotmail account
Jackson - Not deserialize string “null” to null object
Reading array from txt file?
how to set pom.xml to run main class in maven project in netbeans
Select in Tapestry with name not id

Categories

HOME
cakephp
google-chrome-extension
wso2-am
bluetooth
cloud
proxy
session
alfresco
mean-stack
read-eval-print-loop
q
paw-app
jxls
serverspec
podio
adfs
windows-phone-7
hapi
clojurescript
finite-automata
flux
beyondcompare
firefox-webextensions
jasonette
errorlevel
extjs5
devops
claims-based-identity
lcd
dxf
facet
rst2pdf
greendao
opentype
compatibility
data-manipulation
ioio
uiswipegesturerecognizer
azure-sql-database
wpf-controls
dartium
swisscomdev
starteam
graphenedb
reportingservices-2005
elmah
glew
http-redirect
wptoolkit
babel-core
avconv
xml-documentation
logparser
dropbox-php
colorama
np-complete
r-forge
epson
linode
eventkit
migradoc
angular-strap
medium.com
nxt
azure-sdk
file-writing
django-debug-toolbar
gstreamer-0.10
markojs
nsviewcontroller
hill-climbing
qgraphicsview
nessus
msys
lib.web.mvc
citrus-pay
jqgrid-formatter
riak-cs
ibaction
dereference
notify
typekit
java-metro-framework
article
system.net.webexception
bundles
intentservice
soundtouch
coverflow
opcache
dataservice
mhtml
isnullorempty
objective-c-2.0
transactionscope
subgurim-maps
joyent
xdomainrequest
cinema-4d
mysql-error-1005
datareader
nintendo-ds
iweb
adrotator
defensive-programming
genealogy

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App