In your Connector entries in Tomcat's server.xml file (in the conf directory) 
add  enableLookups="true"

    <Connector port="8080" maxHttpHeaderSize="8192" URIEncoding="UTF-8"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="true"  redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true"
               compression="on" compressionMinSize="2048"
               noCompressionUserAgents="gozilla, traviata"
               compressableMimeType="text/html,text/xml" />

By default Tomcat does not turn on machine name resolution.  Personally I added 
the  enableLookups="true"   to all of the Connector entries in the file.  After 
updating the config file stop and restart Tomcat.  Your Java function should 
then work.

The other Java function I use is to get the IP (put it in the same .jsp file).
function env_get_ip_info()
{
  var return_value = "<%= request.getRemoteAddr() %>";
  return (return_value)
}

Fred

From: Action Request System discussion list(ARSList) 
[mailto:[email protected]] On Behalf Of Veeral Oza
Sent: Wednesday, May 05, 2010 7:38 AM
To: [email protected]
Subject: Re: Windows UserID

**
Forgot to mention environment:

ARS 7.0
ITSM 7.0.3
Midtier: 7 on Apache-Tomcat on a Windows machine.
Oracle 11g database.
On Wed, May 5, 2010 at 6:05 PM, Veeral Oza 
<[email protected]<mailto:[email protected]>> wrote:

Hi,

I am stuck at this requirement and was wondering if this is feasible to 
implement:

1) When an Incident is resolved, an email goes to the customer to submit a 
survey, with a survey link.
2) The link opens the survey form in the brower without the user authenticating 
in the midtier. A surver-user with a restricted read license is created for 
this purpose which allows multiple people from multiple locations to submit the 
survey.
3) There is a submit button on this survey form.
4) When the user clicks on submit button, it is required that, his Windows User 
ID be captured in one of the fields.
_______________________________

Solutions implemented that did not work:
1)
Create a little Java function in a .jsp file and put it in your "shared"
folder on your Midtier:

Name the file something like /arsys/shared/get_remote_user.jsp.

get_remote_user.jsp contains:

function env_ip_var()
{
var return_value = "<%=request.getRemoteUser()%>";
return (return_value)
}

In the Web Header content of the form you want to capture this on,
add...

<SCRIPT src="/arsys/shared/get_remote_user.jsp"
language="JavaScript"></SCRIPT>

To set a field with the data from the JavaScript functions do the
following in an active link...

Run Process Command Line:
javascript:window.F(XXXXXXXX).DoSet(env_hostname());

Be sure to change XXXXXXXX with the field ID of the field you want to
set.

This did not work, function env_ip_var returns null.

____________________________________________
Solution 2:

A set fields actions in an active link:
$PROCESS$ CMD /C "set username"

This worked only in user tool. However this functionality is required for web.

___________________________________________

If you have any other ideas, please do share.

Regards,
Veeral Oza



_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug10 www.wwrug.com ARSlist: "Where the Answers Are"

Reply via email to