Java Mailing List Archive

http://www.junlu.com/

Home » users-digest.tomcat »

users Digest 26 Mar 2013 13:07:22 -0000 Issue 11316

users-digest-help

2013-03-26


Author LoginPost Reply

users Digest 26 Mar 2013 13:07:22 -0000 Issue 11316

Topics (messages 240737 through 240751)

Re: runtime.exec "cmd.exe /C net use"
 240737 by: Howard W. Smith, Jr.
 240739 by: Howard W. Smith, Jr.
 240740 by: Howard W. Smith, Jr.
 240750 by: Harris, Jeffrey E.
 240751 by: Howard W. Smith, Jr.

Tomcat 6 centos 5 64 Bit
 240738 by: Sean
 240742 by: Ognjen Blagojevic
 240745 by: Mark Thomas
 240748 by: Ognjen Blagojevic

Re: IWA username using JSP for Already authenticated Window system
 240741 by: Cédric Couralet

Encoding Problem
 240743 by: Cool Techi
 240744 by: Konstantin Kolinko
 240746 by: Cool Techi
 240747 by: Konstantin Kolinko
 240749 by: Cool Techi

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: users@(protected)
To unsubscribe, e-mail: users-digest-unsubscribe@(protected)
For additional commands, e-mail: users-digest-help@(protected)

----------------------------------------------------------------------


Attachment: users_240737.eml (zipped)
On Mon, Mar 25, 2013 at 10:10 PM, Howard W. Smith, Jr. <
smithh032772@(protected):

> On Mon, Mar 25, 2013 at 6:57 PM, Patrick Flaherty <pflahrty@(protected)
> > wrote:
>
>>
>> On Mar 25, 2013, at 1:15 PM, Howard W. Smith, Jr. wrote:
>>
>> On Mon, Mar 25, 2013 at 11:14 AM, Patrick Flaherty
>>> <pflahrty@(protected):
>>>
>>> Update: If I'm login interactively (meaning machine boots and I login
>>>> and
>>>> get my desktop) and that interactive account matches the service login
>>>> account
>>>> then "net use" from within the service does return all mapped drives.
>>>>
>>>>
>>>> I expected as much. It seems as though you cannot get away from the
>>> requirement of having to login 'first'...to get everything working as
>>> designed/expected in your app.
>>>
>>> Excuse me, if I missed the business requirement specification (earlier in
>>> this conversation), but is the requirement only to get a list of mapped
>>> drives for 'your' user login or any enduser that logs into the production
>>> server/client/PC/machine?
>>>
>>> can you add the list of network drives to a database table, and maintain
>>> the database table and retrieve the list from that database table via the
>>> tomcat-app-running-as-service?
>>>
>>> if you only need a list of mapped network drives for your user login, can
>>> you just maintain a 'file' that has this list on the target/production
>>> server, and whenever it changes, can you update the file, and make the
>>> topcat-app-running-as-service to always read the file instead of having
>>> to
>>> call 'net use'?
>>>
>>> IMHO and FWIW, i would never go with the approach of relying on a windows
>>> 'command line' to do this/that for me. yes, in my app, i allow endusers
>>> to
>>> update files/documents, and the app saves the files/documents to a
>>> certain
>>> folder on the server, and my app will list those files on a web page, and
>>> they can view/download those files from/via the web app... all that is
>>> done
>>> via java instead of doing a 'cmd.exe dir'. i'm new to java, always wanted
>>> to be java developer, and loving what i can do with java. i'm almost
>>> getting to the point, where my days of a 'windows user' are done... one
>>> day, i hope to migrate to linux for target server instead of windows
>>> server. :)
>>>
>>
>> This is what I see. If my service logs in as "service-user" and I login
>> normally to my desktop as "dt-user".
>> I call "net use" from my service and get an empty list. Now I logout as
>> "dt-user"and login as "service-user" and I mapped
>> 4 drives and only 2 of the drives are mapped persisted (i.e. reconnect at
>> logon). I logout as "service-user" and
>> now I have my app call "net use" programatically and it returns the 2
>> drives that were mapped with persistence.
>> Conclusion: Whatever drives are mapped persisted when logged in as the
>> user the service logs in as, then your
>> app can call "net use" and get those drives returned from "net use" even
>> if your logged in as "dt-user" OR nobody
>> is logged in at all !!!!
>>
>> Maybe someone can confirm my finding, but this is what I see.
>>
>>
> Your findings are all good; reading and digesting and wanting to
> respond/participate since I'm definitely a developer using/deploying-app to
> Windows/tomcat7 . :)
>
> If you could provide a WAR (little test app), I would be more than willing
> to give this a shot on my Windows Server 2008 64-bit (standard/Vista)
> development server and maybe even try it on my Windows Server 2008 R2
> 64-bit (R2 = Windows 7, from what I understand), but I'd have to setup a
> Windows user/environment for this...to mimic what you're doing.
>
> Now, onto the other responses. :)
>
>
Sorry, I was going to say, I still would develop some type of batch file or
some type of app that could run when user logs out of the machine...that
will do a 'net use > \someDriveLetter\someFolder\someFile.txt', and I would
make sure the app reads that file instead of going through the procedure of
logging in as a certain user, logging out, and then running your
tomcat-app-as-service...just so the app can reliably call 'net use' and get
the expected/desired output.

maybe i should have written this response against the last email that you
sent. :)



>
>> Thanks again
>> Pat
>>
>>
>>
>>
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.org<users-unsubscribe@(protected)>
>> For additional commands, e-mail: users-help@(protected)
>>
>>
>

Attachment: users_240739.eml (zipped)
On Mon, Mar 25, 2013 at 7:13 PM, Harris, Jeffrey E. <
Jeffrey.Harris@(protected):

>
> You are on a Windows 7 system, which supports one user logged in at a time.
> I would be interested in seeing how this behaves on a Windows Server 2008
> R2 system,
> configured for multiple users to be logged on at the same time (the
> default for remote
> administration mode is one user at a time). I do believe this is an
> artifact of the
> Windows 7 architecture (one user at a time) because Windows Server 2008 R2
> has different
> "security zones" (rings) in its kernel implementation for access by
> different components
> (services, drivers, and users) which affect the presentation to the user.
>

First of all, interesting/nice response!

I have Windows Server 2008 R2 (hosting tomcat7/tomee, which is running my
java/JSF web app), but I currently do not have the server
on-or-connected-to any domain (at the moment, and currently there is no
need/requirement for it to be connected to the current Windows domain on
the network); my Windows Server 2003 R2 server is currently (and has
been...for years) running as the domain controller on the network. So, my
Windows Server 2008 R2 server is currently not configured to test this and
provide test results.



> Also, persistent mappings are user specific. So if usera has two
> persistent drive mappings and
> userb has three different persistent mappings, usera will see his two when
> he is logged on and
> userb will see his three when he is logged on. Do you have the same
> persistent mappings for dt-user
> and service-user? You have also stated that you see no mapped drives when
> you run the service, so
> it seems as though starting the service first (and never having anyone
> logged in or dt-user) is an exception.
> Therefore, by extension of what you said above, you only receive the
> mapped drives if
> 1) the service starts first and then the service account logs in
> interactively, or
> 2) the service starts after logging in with the service account. Did you
> try both of these?
> But once the service "sees" the mappings, it retains it until: the
> service restarts? Does
> it matter whether the service restarts with someone logged on (i.e., the
> service account) or no one
> logged in?
>
> I do not think that you have explored all of the conditions required for
> the service to maintain
> its mappings, and that may be fine for your application, but then again,
> it may not be. That is
> for you to decide.
>
> Jeffrey Harris
>
> This e-mail and any attachments are intended only for the use of the
> addressee(s) named herein and may contain proprietary information. If you
> are not the intended recipient of this e-mail or believe that you received
> this email in error, please take immediate action to notify the sender of
> the apparent error by reply e-mail; permanently delete the e-mail and any
> attachments from your computer; and do not disseminate, distribute, use, or
> copy this message and any attachments.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>

Attachment: users_240740.eml (zipped)
On Mon, Mar 25, 2013 at 8:05 PM, Patrick Flaherty
<pflahrty@(protected):

>
> I did not know you could have multiple logins in Windows 2008 R2. You
> don't mean interactive login do you?
>
>
When I first started using Windows Server 2008 (standard/vista version), I
had multiple 'local' users, and the server allowed at least 2 users to be
logged in at one time, and I think I remember the ability to switch between
users via Ctrl-Alt-Delete and/or via Ctrl-L (lock workstation). I would
assume the same is available for Windows Server 2008 R2, but have not tried
it.

did a google search and found this[1]. can you do something similar, create
a separate java app/executable that does your 'net use', and let your
tomcat7-app-running-as-service call the separate app, and 'run as' the
target user that has the network drive list that you desire to
get/retrieve? just a suggestion.

[1] http://stackoverflow.com/questions/1385866/java-run-as-administrator

Attachment: users_240750.eml (zipped)


> -----Original Message-----
> From: Patrick Flaherty [mailto:pflahrty@(protected)]
> Sent: Monday, March 25, 2013 8:06 PM
> To: Tomcat Users List
> Subject: Re: runtime.exec "cmd.exe /C net use"
>
>
> On Mar 25, 2013, at 7:13 PM, Harris, Jeffrey E. wrote:
>
>
> After the the drives are mapped persisted by the "service-user", I
> reboot the computer and have nobody login interactively and my app sees
> all drives that were mapped persistently using "net use". That is my
> app running as a service can programatically see the drives via "net
> use". It is able to derive the drives that were mapped
> *persisted* somehow someway. I have no idea if it's by design or
> whether or not I can hang my hat on it, but it is what I have observed.
>

Someone would have to do further research to explain why this works. I cannot.

> I did not know you could have multiple logins in Windows 2008 R2. You
> don't mean interactive login do you?
>

Yes, interactively, but remotely. Every Windows operating system since Windows Server 2000
supports "remote administration mode" which out of the box allows two remote terminal
sessions by administrators (or other users given the right to log in remotely).
There is actually a third session allowed, which is the console (local) session. There can
only be one user logged in at a time to the console, but it can be any user that
exists as a local account on the server or a domain user if the server is in a domain
(the one exception is domain controllers; by default, only administrators and accounts
in certain other groups can log in locally to a domain controller).

However, in Windows Server 2008 and later, they changed the default so only one user is logged
in at a time, ala Windows 7, but unlike Windows 7, it can revert to the earlier behavior by
changing local or group policy to allow multiple user logins (up to the three discussed
previously).

If you buy a terminal server license, then the cap on two users is removed (to the limit
specified in the terminal server license), and any users can log in remotely.

> I hope this is clear and thanks for keeping me honest.
> -Pat
>
> >

This e-mail and any attachments are intended only for the use of the addressee(s) named herein and may contain proprietary information. If you are not the intended recipient of this e-mail or believe that you received this email in error, please take immediate action to notify the sender of the apparent error by reply e-mail; permanently delete the e-mail and any attachments from your computer; and do not disseminate, distribute, use, or copy this message and any attachments.


Attachment: users_240751.eml (zipped)
On Tue, Mar 26, 2013 at 8:40 AM, Harris, Jeffrey E. <
Jeffrey.Harris@(protected):

>
>
>
If you buy a terminal server license, then the cap on two users is removed
> (to the limit
> specified in the terminal server license), and any users can log in
> remotely.
>
>
That's exactly right.

In Microsoft terms, terminal server license = Client Access License (CALs).
Per my experience, Windows Server 2003 (standard version) is sold with 2
CALs, and you can purchase additional, such as 5 CALs, etc...

Recently, for the web app that I developed, we got Windows Server 2008 R2,
and I think we purchased it with 5 CALs.

Client Access Licenses (CALs) allow you to have that many people login
simultaneously on the server.

For years and ever since we purchased it, only 2 people were able to login
to the Windows Server 2003 'remotely' (via Remote Desktop). Why? because we
had the default/bundled 2 CALs.

Attachment: users_240738.eml (zipped)

-- Hello, I have setup tomcat6 on port 8080 using 64 bit- Centos 5. I am able to see the default tomcat page, but if I try to go to the webadmin gui (and yes have set my gui-web admin user, etc in server.xml) and or geoserver web app it says connection timed out. Thus, I usually restart tomcat and am able to connect to geoserver, but as soon as i try to login then i get the no connection message and can only access the localhost:8080 page again.

Cheers,


Sean Conway

GIS Specialist

scconway8@gmail.com


          

Attachment: users_240742.eml (zipped)
Sean,

On 26.3.2013 4:14, Sean wrote:
> Hello, I have setup tomcat6 on port 8080 using 64 bit- Centos 5. I am
> able to see the default tomcat page, but if I try to go to the webadmin
> gui (and yes have set my gui-web admin user, etc in server.xml) and or
> geoserver web app it says connection timed out. Thus, I usually restart
> tomcat and am able to connect to geoserver, but as soon as i try to
> login then i get the no connection message and can only access the
> localhost:8080 page again.

You are posting to wrong (dev) mailing list. Please post your question
to user mailing list.

-Ognjen


Attachment: users_240745.eml (zipped)
On 26/03/2013 08:55, Ognjen Blagojevic wrote:
> Sean,
>
> On 26.3.2013 4:14, Sean wrote:
>> Hello, I have setup tomcat6 on port 8080 using 64 bit- Centos 5. I am
>> able to see the default tomcat page, but if I try to go to the webadmin
>> gui (and yes have set my gui-web admin user, etc in server.xml) and or
>> geoserver web app it says connection timed out. Thus, I usually restart
>> tomcat and am able to connect to geoserver, but as soon as i try to
>> login then i get the no connection message and can only access the
>> localhost:8080 page again.
>
> You are posting to wrong (dev) mailing list. Please post your question
> to user mailing list.

No, this *is* the user list.

Mark



Attachment: users_240748.eml (zipped)
Sean,
Mark,

On 26.3.2013 10:16, Mark Thomas wrote:
> On 26/03/2013 08:55, Ognjen Blagojevic wrote:
>> Sean,
>>
>> On 26.3.2013 4:14, Sean wrote:
>>> Hello, I have setup tomcat6 on port 8080 using 64 bit- Centos 5. I am
>>> able to see the default tomcat page, but if I try to go to the webadmin
>>> gui (and yes have set my gui-web admin user, etc in server.xml) and or
>>> geoserver web app it says connection timed out. Thus, I usually restart
>>> tomcat and am able to connect to geoserver, but as soon as i try to
>>> login then i get the no connection message and can only access the
>>> localhost:8080 page again.
>>
>> You are posting to wrong (dev) mailing list. Please post your question
>> to user mailing list.
>
> No, this *is* the user list.

I'm sorry. It was honest mistake, I somehow thought it was posted on the
dev list.

Regarding Sean's original question:

1. Tomcat homepage suggest that you installed Tomcat correctly, that is
good.

2. Timeout suggest either:

a. your URL is not correct -- check protocol, server name, and port. If
everything seems fine, check Tomcat access logs to see if your request
was ever handled by Tomcat.

b. your application is unresponsive -- high CPU usage, garbage
collection happening to, or something similar. Check your logs to see if
there is something suspicious: e.g. OutOfMemoryError or PermGen space
error. If logs are clear, you should use JVisualVM or similar monitoring
tool to figure out what is going on while your web application is
unresponsive.

-Ognjen





Attachment: users_240741.eml (zipped)
>>
>> One thing to watch for is that the client must use Kerberos and not
>> NTLM (it's a guess but it seems logical) .
>
>
> Sorry to burst in, but can you elaborate on that ?
> Why does it seem logical ? To my own (admittedly limited) knowledge,
> Kerberos is not the most widely implemented solution in Windows networks,
> NTLMv2 is. Does the SPNEGO implementation in Tomcat not work with NTLMv2
> then ?
>
Only on a linux box.
In my mind, NTLM being a Microsoft protocol, the chance of it working
on a linux box was small.

That is what I observed. When the tomcat on my linux was configured
with the SPNEGO valve, at first my browser was talking NTLM
(apparently, you can see that when the first reponse to the negotiate
challenge begins with NTRLM...), and I got an error in tomcat log
saying can't validate client ticket.

Once i declared the box in the active directory dns, my browser
stopped using NTLM for Kerberos and everything works as expected.

It should be apparent I'm really not an expert on that, so all that is
just some guesses. I'm still studying all that.


Attachment: users_240743.eml (zipped)

    We are working with multiple languages and Korean being one
of them, in our application we have set up encoding both at tomcat level
and also spring filter for encoding, but for some reason when we do a
request.getParameter in our Struts2 action class we receive only ??.

Tomcat Encoding

<Connector port="8080" protocol="HTTP/1.1"
      connectionTimeout="20000" maxThreads="150"
      redirectPort="8443" URIEncoding="UTF-8"/>


Spring Filter

<filter>
  <filter-name>encodingFilter</filter-name>
  <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  <init-param>
    <param-name>encoding</param-name>
    <param-value>UTF-8</param-value>
  </init-param>
  <init-param>
    <param-name>forceEncoding</param-name>
    <param-value>true</param-value>
  </init-param>
</filter>


EDIT

So a message which are sent as "안녕하세요 kkk" is received as "????? kkk"

What could I be missing?

Regards,

Ayush

             

Attachment: users_240744.eml (zipped)
2013/3/26 Cool Techi <cooltechie@(protected)>:
>
>      We are working with multiple languages and Korean being one
> of them, in our application we have set up encoding both at tomcat level
> and also spring filter for encoding, but for some reason when we do a
> request.getParameter in our Struts2 action class we receive only ??.
>
> Tomcat Encoding
>
> <Connector port="8080" protocol="HTTP/1.1"
>        connectionTimeout="20000" maxThreads="150"
>        redirectPort="8443" URIEncoding="UTF-8"/>
>
>
> Spring Filter
>
> <filter>
>   <filter-name>encodingFilter</filter-name>
>   <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
>   <init-param>
>     <param-name>encoding</param-name>
>     <param-value>UTF-8</param-value>
>   </init-param>
>   <init-param>
>     <param-name>forceEncoding</param-name>
>     <param-value>true</param-value>
>   </init-param>
> </filter>
>
>
> EDIT
>
> So a message which are sent as "안녕하세요 kkk" is received as "????? kkk"
>
> What could I be missing?
>

1. What is your <filter-mapping> and in what place in filters chain
does you filter stand. (Order matters here. If anything calls
getParameter() before you filter, parameter decoding happens and you
are busted).

2. What kind of request fails, POST or GET or both?

3. Have you read the character encodings page of Tomcat FAQ?


Attachment: users_240746.eml (zipped)
1. What is your <filter-mapping> and in what place in filters chain does you filter stand. (Order matters here. If anything calls getParameter() before you filter, parameter decoding happens and you are busted).

It is the first in the list of filters.

2. What kind of request fails, POST or GET or both?

POST is the one in question currently, will test GET.

3. Have you read the character encodings page of Tomcat FAQ?

Yes

Regards,
Rohit

> Date: Tue, 26 Mar 2013 13:14:19 +0400
> Subject: Re: Encoding Problem
> From: knst.kolinko@(protected)
> To: users@(protected)
>
> 2013/3/26 Cool Techi <cooltechie@(protected)>:
> >
> >      We are working with multiple languages and Korean being one
> > of them, in our application we have set up encoding both at tomcat level
> > and also spring filter for encoding, but for some reason when we do a
> > request.getParameter in our Struts2 action class we receive only ??.
> >
> > Tomcat Encoding
> >
> > <Connector port="8080" protocol="HTTP/1.1"
> >        connectionTimeout="20000" maxThreads="150"
> >        redirectPort="8443" URIEncoding="UTF-8"/>
> >
> >
> > Spring Filter
> >
> > <filter>
> >   <filter-name>encodingFilter</filter-name>
> >   <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
> >   <init-param>
> >     <param-name>encoding</param-name>
> >     <param-value>UTF-8</param-value>
> >   </init-param>
> >   <init-param>
> >     <param-name>forceEncoding</param-name>
> >     <param-value>true</param-value>
> >   </init-param>
> > </filter>
> >
> >
> > EDIT
> >
> > So a message which are sent as "안녕하세요 kkk" is received as "????? kkk"
> >
> > What could I be missing?
> >
>
> 1. What is your <filter-mapping> and in what place in filters chain
> does you filter stand. (Order matters here. If anything calls
> getParameter() before you filter, parameter decoding happens and you
> are busted).
>
> 2. What kind of request fails, POST or GET or both?
>
> 3. Have you read the character encodings page of Tomcat FAQ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
           

Attachment: users_240747.eml (zipped)
2013/3/26 Cool Techi <cooltechie@(protected)>:
> 1. What is your <filter-mapping> and in what place in filters chain does you filter stand. (Order matters here. If anything calls getParameter() before you filter, parameter decoding happens and you are busted).
>
> It is the first in the list of filters.
>
> 2. What kind of request fails, POST or GET or both?
>
> POST is the one in question currently, will test GET.
>
> 3. Have you read the character encodings page of Tomcat FAQ?
>
> Yes
>
> Regards,
> Rohit
>
>> Date: Tue, 26 Mar 2013 13:14:19 +0400
>> Subject: Re: Encoding Problem
>> From: knst.kolinko@(protected)
>> To: users@(protected)
>>
>> 2013/3/26 Cool Techi <cooltechie@(protected)>:
>> >
>> >      We are working with multiple languages and Korean being one
>> > of them, in our application we have set up encoding both at tomcat level
>> > and also spring filter for encoding, but for some reason when we do a
>> > request.getParameter in our Struts2 action class we receive only ??.
>> >
>> > Tomcat Encoding
>> >
>> > <Connector port="8080" protocol="HTTP/1.1"
>> >        connectionTimeout="20000" maxThreads="150"
>> >        redirectPort="8443" URIEncoding="UTF-8"/>
>> >
>> >
>> > Spring Filter
>> >
>> > <filter>
>> >   <filter-name>encodingFilter</filter-name>
>> >   <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
>> >   <init-param>
>> >     <param-name>encoding</param-name>
>> >     <param-value>UTF-8</param-value>
>> >   </init-param>
>> >   <init-param>
>> >     <param-name>forceEncoding</param-name>
>> >     <param-value>true</param-value>
>> >   </init-param>
>> > </filter>
>> >
>> >
>> > EDIT
>> >
>> > So a message which are sent as "안녕하세요 kkk" is received as "????? kkk"
>> >
>> > What could I be missing?
>> >
>>
>> 1. What is your <filter-mapping> and in what place in filters chain
>> does you filter stand. (Order matters here. If anything calls
>> getParameter() before you filter, parameter decoding happens and you
>> are busted).
>>
>> 2. What kind of request fails, POST or GET or both?
>>
>> 3. Have you read the character encodings page of Tomcat FAQ?
>>

1. Do not top-post
http://tomcat.apache.org/lists.html#tomcat-users

2. Is HTML page that submits the form served with UTF-8?

If not, the browser will use a different charset to send the data.

3. You may try debugging the getParameter() call
http://wiki.apache.org/tomcat/FAQ/Developing#Debugging

You will see whether parameter decoding occurs, or
it has already occurred at that point, and what data it processes.


Best regards,
Konstantin Kolinko


Attachment: users_240749.eml (zipped)
This is unfortunately happening in our production server and not on or local servers, hence debugging has become more difficult.

On local servers everything is working fine, both POST and GET requests.

Regards,
Ayush

> Date: Tue, 26 Mar 2013 14:16:24 +0400
> Subject: Re: Encoding Problem
> From: knst.kolinko@(protected)
> To: users@(protected)
>
> 2013/3/26 Cool Techi <cooltechie@(protected)>:
> > 1. What is your <filter-mapping> and in what place in filters chain does you filter stand. (Order matters here. If anything calls getParameter() before you filter, parameter decoding happens and you are busted).
> >
> > It is the first in the list of filters.
> >
> > 2. What kind of request fails, POST or GET or both?
> >
> > POST is the one in question currently, will test GET.
> >
> > 3. Have you read the character encodings page of Tomcat FAQ?
> >
> > Yes
> >
> > Regards,
> > Rohit
> >
> >> Date: Tue, 26 Mar 2013 13:14:19 +0400
> >> Subject: Re: Encoding Problem
> >> From: knst.kolinko@(protected)
> >> To: users@(protected)
> >>
> >> 2013/3/26 Cool Techi <cooltechie@(protected)>:
> >> >
> >> >      We are working with multiple languages and Korean being one
> >> > of them, in our application we have set up encoding both at tomcat level
> >> > and also spring filter for encoding, but for some reason when we do a
> >> > request.getParameter in our Struts2 action class we receive only ??.
> >> >
> >> > Tomcat Encoding
> >> >
> >> > <Connector port="8080" protocol="HTTP/1.1"
> >> >        connectionTimeout="20000" maxThreads="150"
> >> >        redirectPort="8443" URIEncoding="UTF-8"/>
> >> >
> >> >
> >> > Spring Filter
> >> >
> >> > <filter>
> >> >   <filter-name>encodingFilter</filter-name>
> >> >   <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
> >> >   <init-param>
> >> >     <param-name>encoding</param-name>
> >> >     <param-value>UTF-8</param-value>
> >> >   </init-param>
> >> >   <init-param>
> >> >     <param-name>forceEncoding</param-name>
> >> >     <param-value>true</param-value>
> >> >   </init-param>
> >> > </filter>
> >> >
> >> >
> >> > EDIT
> >> >
> >> > So a message which are sent as "안녕하세요 kkk" is received as "????? kkk"
> >> >
> >> > What could I be missing?
> >> >
> >>
> >> 1. What is your <filter-mapping> and in what place in filters chain
> >> does you filter stand. (Order matters here. If anything calls
> >> getParameter() before you filter, parameter decoding happens and you
> >> are busted).
> >>
> >> 2. What kind of request fails, POST or GET or both?
> >>
> >> 3. Have you read the character encodings page of Tomcat FAQ?
> >>
>
> 1. Do not top-post
> http://tomcat.apache.org/lists.html#tomcat-users
>
> 2. Is HTML page that submits the form served with UTF-8?
>
> If not, the browser will use a different charset to send the data.
>
> 3. You may try debugging the getParameter() call
> http://wiki.apache.org/tomcat/FAQ/Developing#Debugging
>
> You will see whether parameter decoding occurs, or
> it has already occurred at that point, and what data it processes.
>
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
           
©2008 junlu.com - Jax Systems, LLC, U.S.A.