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

Deploy Spring boot in weblogic 12c - INSTANCE
Context Menu - Align some text left, and some text right
Using Akka actors to download many files
How to configure Nginx root location proxy pass for a tomcat cluster
How to resolve this conflicting of two beans with same name in maven project?
Socket url connect/disconnect every time while passing message form android
improperly called by android.widget.LinearLayout - Activity can't launch
JavaMail API Sending email via Gmail SMTP
Maven build fails on Jenkins
ValueAnimator makes one element disappear?
Can JavaParser recognize the feed to BufferedReader?
Enable exec-maven-plugin while executing jar through java command
How to bind value of property to collection in Mybatis?
i want to create a simple generic method to count the numbers after applying filter
Get PID of some running task
Can Attribute reference in python be compared with static class in Java ?

Categories

HOME
netsuite
deezer
plone
appx
cmd
infragistics
alpha
blueprintjs
wamp
convolution
django-imagekit
vifm
row
handsontable
php-7.1
apache-cayenne
usergrid
iolanguage
autocad-plugin
kryo
one-hot-encoding
orleans
hammerspoon
su
status
brunch
social-media
jspm
webkitspeechrecognition
unboundid
socialengine
http-status-code-503
winrt-xaml-toolkit
swift3.0.2
dynamics-crm-2013
c11
uft-api
unobtrusive-validation
unoconv
eclipse-scout
sfdc
fakeiteasy
no-www
mime
user-accounts
hls.js
veracode
idisposable
google-perftools
qtwebview
python-cryptography
color-profile
account-kit
deadbolt-2
azure-sdk
savon
phpcas
pervasive-sql
deis
microbenchmark
bridge.net
fscommand
sorl-thumbnail
qpainter
code-access-security
bitcoinj
android-radiobutton
jboss-weld
resty-gwt
typo3-neos
imdbpy
gridfs
runtime.exec
yui-compressor
android-screen-support
mqx
html-editor
typoscript2
isnullorempty
nsmanagedobject
amazon-appstore
rfc1123
self-extracting
file-comparison
mysql-error-1005
forums
sef
ti-dsp
xetex
port-number
dbisam

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App