Pass extra header variable in login request
Hi all,
I would like to know if it is possible to pass an extra header variable in the login request when doing Single Sign-on.
We have a few applications which use request header variable for login, but this variable name is different from the standard variable name.
Do I need to write a login module which just passes the userId using this new variable name, or is there a simpler/smarter solution?
Any help would be greatly appreciated!
Thanks in advance,
Robin van het Hof
Try this:
For 2004s/7.0:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b00a87e5-0601-0010-87a7-9c0456cf8436
http://help.sap.com/saphelp_nw04s/helpdata/en/61/f8bc3d52f39d33e10000000a11405a/frameset.htm
for nw2004:
http://help.sap.com/saphelp_nw04/helpdata/en/61/f8bc3d52f39d33e10000000a11405a/frameset.htm
Not sure if it'll help, but there is an area in the above docs that talks about customizing login modules, and you can get at passed parameters in the login module.
Good luck!
Similar Messages
-
How to pass a header variable in jsp
Hi ,
I am using Headervariable login module(which takes user id form http header variable) for single sign on.
I configured the login module stack. But to test i need a jsp from which i can pass the user id in http header.
to test if i am able to set the user id in http header , i have written 2 jsps
1. Header.jsp
In this , i am setting the user id
response.addHeader("UserId" ,"user1");
and i am posting it to HeaderResult.jsp
2.HeaderResult.jsp
In this, i am tryng to rretrieve it By using
request.getHeader("UserId");
But i am not geeting any value.
Can i set user defined header variables?if not, can i set the standard http header variabes,
Please help me with the code.
Thanks,
LakshmiHi,
check this thread
http://help.sap.com/saphelp_nw04/helpdata/en/71/bcf3bf2ed7e142a5011b43c288f08c/content.htm
HTTP Header parameters in iView.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/bc-jas/~form/handler
May help you
Regards,
RK -
How to pass soap header variable for invoking siebel service in BPEL
Hi,
I am invoking siebel service in soa composite. siebel service have header variables username/password and session type. I have created global variable (message type) in BPEL anddeclare same in messages port in siebel wsdl. after that I passed the username/password and session type as hard coded in assign activity. I have deployed and tested this but, I have an exception like javax.xml.ws.soap.SOAPFaultException: Error Code: 10944642 Error Message: Error: Inbound SOAP Message - Session Token is missing or invalid or has expired
Can you please help on this..Hi,
check this thread
http://help.sap.com/saphelp_nw04/helpdata/en/71/bcf3bf2ed7e142a5011b43c288f08c/content.htm
HTTP Header parameters in iView.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/bc-jas/~form/handler
May help you
Regards,
RK -
Error in setting up HTTP Header Variable Authentication
Hi,
I am trying to set-up SSO for SAP Biller Direct aplication (deployed on SAP J2EE 7.0) using HTTP Header variable authentication.
As per SAP documentation I have created a new login module "HeaderVariableLoginModule" pointing to class "com.sap.security.core.server.jaas.HeaderVariableLoginModule".
Then I have added this new login module to Statck "Ticket" and the new config looks as below. HTTP header when UID is passed is USI_LOP.
Name Flag Options
com.sap.security.core.server.jaas.HeaderVariableLoginModule Sufficient ume.configuration.active= tue,
Header=USI_LOP
BasicPasswordLoginModule Optional
CreateTicketLoginModule Optional ume.configuration.active= tue
EvaluateTicketLoginModule Sufficient ume.configuration.active= tue
The problem I am now having is that the authentication through HTTP_HEADEr does not work. Even though I ahve increased the trace level for JAAS module to debug, there is not any type of information generated in the log.
Each time I call the Biller Direct URL from the extrenal web server which also passes the HEADER variable for Authntication, the authrisation just fails and I am being shown a Logon Screen to pust UID/PASSWORD.
Can someone please guide me, how I can debug this? There is very no information whether anyone tried to login with HEADER varibale and that has failed...
Also, I am not pretty sure whether I am using the right Authentication Stack, which is is Ticket in my case..
But when I enter the application without any URL redirects and enter UID and password directly for Biller Direct, I get the following in log file, which makes me believe that I am using the right stack.
LOGIN.OK
User: CONDLG
Authentication Stack: ticket
Login Module Flag Initialize Login Commit Abort Details
1. com.sap.security.core.server.jaas.HeaderVariableLoginModule SUFFICIENT ok false false
2. com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule OPTIONAL ok true true
3. com.sap.security.core.server.jaas.CreateTicketLoginModule OPTIONAL ok true true
4. com.sap.security.core.server.jaas.EvaluateTicketLoginModule SUFFICIENT ok false false
Central Checks true
Any help will be very much apprecated..
Thanks,
Vikrant SudVikrant,
The reason why it is not working is because your login modules in ticket stack are in wrong order and with wrong flags. The first one should be EvaluateTicketLoginModule with flag=SUFFICIENT, then the Header Variable login module, with flag=OPTIONAL, then CreateTicketLoginModule with flag=SUFFICIENT, then BasicPasswordLoginModule with flag=REQUISITE, and lastly CreateTicektLoginModule with flag=OPTIONAL
Thanks,
Tim -
SSO to other apps via HTTP header variable
We are on NW EP6.0 SP16. We need to add the "user id" as http header variable so that other apps which are non SAP can access our header variable and log on with that user id. Is this available by default? Or we want to achieve this how best we can achieve this.
We can use the code to get the user id and add it to header variable. If we use this route which is the jsp page we need to add the code?
ThanksHi,
we can you login modules provided by SAP to accomplish this.. you can use header variable authentication login module to acheive your requirement.
please refer: http://help.sap.com/saphelp_nw04/helpdata/en/8f/ae29411ab3db2be10000000a1550b0/frameset.htm
Hope that helps.
Regards,
S.Divakar -
How to pass header Variables along with body
Hi,
Here I am invoking siebel web service which is wsdl(SOAP) based web service. I tested it through sopaUI and it is working fine for me as I am getting proper response. here is the input payload structure.
Note: it is running on HTTPS, so SSL has been applied to this site.
it is loading as http not https. For every operation when we make a request, we are changing the link to https and submitting it. Then it is working for us.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.xxxxxx.com/2005/">
<soapenv:Header>
<ns:AuthorizationToken>
<ns:Token>userName;Password</ns:Token>
</ns:AuthorizationToken>
</soapenv:Header>
<soapenv:Body>
<ns:WEBIndividualGet>
<ns:key>{6D803C43-3917-4C99-91F3-003EB9E16E1F}</ns:key>
</ns:WEBIndividualGet>
</soapenv:Body>
</soapenv:Envelope>
Now I created the bpel projects like this.
Step 1:- in the xsd, I created two elements types
<xsd:element name="UsernameToken" type="xsd:string"/>
<xsd:element name="PasswordText" type="xsd:string"/>
Step 2:- Then I created the WSDL in respect to above elements
<!-- Message section -->
<wsdl:message name="WEBAutTokenOut">
<wsdl:part name="userName" element="netObj:UsernameToken"/>
<wsdl:part name="passWord" element="netObj:PasswordText"/>
</wsdl:message>
<wsdl:portType name="portTypeName">
<wsdl:operation name="operationName">
<soap:operation soapAction="sopaAction">
</soap:operation>
<wsdl:input message="netSer:SvcRequestMessage">
<soap:header message="netSer:WEBGetAutToken" part="userName" use="literal"/>
<soap:header message="netSer:WEBGetAutToken" part="passWord" use="literal"/>
</wsdl:input>
<wsdl:output message="netSer:SvcResponseMessage">
<soap:header message="netSer:WEBAutTokenOut" part="userName" use="literal"/>
<soap:header message="netSer:WEBAutTokenOut" part="passWord" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
Step 3:- and My Bpel looks like
<!--Variable Declaration -->
<variable name="customHeaderVar" messageType="netSer:WEBGetAutToken"/>
<variable name="customOutputHeaderVar" messageType="netSer:WEBAutTokenOut"/>
<sequence name="main">
<receive name="receiveInput" partnerLink="xxxxxxx"
portType="netSer:xxxxxxxxxxx" operation="xxxxxx"
variable="inputVariable" createInstance="yes"
bpelx:headerVariable="customHeaderVar"/>
<assign name="AssignHeaderVariables">
<copy>
<from expression='"username"'/>
<to variable="customHeaderVar" part="userName"
query="/ns2:UsernameToken"/>
</copy>
<copy>
<from expression='"soa1234"'/>
<to variable="customHeaderVar" part="passWord"
query="/ns2:PasswordText"/>
</copy>
</assign>
<invoke name="Invoke" inputVariable="xxxxxxxxxxxxxxxx"
outputVariable="Invoke_OutputVar"
partnerLink="xxxxxxxxxxx" portType="ns1:XMLSoap"
operation="WEBGet" bpelx:invokeAsDetail="no"
bpelx:inputHeaderVariable="customHeaderVar">
bpelx:outputHeaderVariables="customOutputHeaderVar"/>
Note: When I am hitting siebel web service it is giving some out put, The output it self has header variable. so that is reason am added outputHeaderVariables.
< Here we have Transformation Activity >
<reply name="replyOutput" partnerLink="xxxxxx"
portType="netSer:xxxxxxx" operation="WEBGet"
variable="outputVariable"
bpelx:inputHeaderVariable="customOutputHeaderVar"/>
That's about my project. But when test this service Am getting error. below is the error details.
==============================================================================
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
<env:Fault>
<faultcode>env:Client</faultcode>
<faultstring>System.Web.Services.Protocols.SoapException: Object reference not set to an instance of an object.
at Avectra.netForum.xWeb.xWebSecure.netForumXMLSecure.WEBIndividualGet(Guid key)</faultstring>
<faultactor/>
<detail>
<exception><![CDATA[<InvalidTokenException xmlns="http://www.xxxxxx.com/2005/">
<XWebException xmlns="http://www.xxxxxx.com/2005/">
<Message>Object reference not set to an instance of an object.</Message>
<Number>0</Number>
<Source>xWebClasses</Source>
<Line>0</Line>
<StackTrace> at Avectra.netForum.xWeb.xWebSecure.xWebServiceClass.ValidateToken(AuthorizationToken AuthToken)
at Avectra.netForum.xWeb.xWebSecure.netForumXMLSecure.WEBIndividualGet(Guid key)</StackTrace>
<ErrorType>GeneralError</ErrorType>
<Errors/>
</XWebException>
</InvalidTokenException>]]></exception>
</detail>
</env:Fault>
</env:Body>
</env:Envelope>
==============================================================
Could you please help me out.
Thanks,The UserNameToken and the Password variables should be created based on the schema http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
Refer the below url for more details.
OracleFusionMiddleWare 10g,11g and AIA: How to set security credentials dynamically in Oracle BPEL
Regards
Albin I
http://www.albinsblog.com/ -
Passing URL variable on login redirect
I first want to say thank you for all the great help I have received on these forums over the past couple months - it has been very helpful and saved me countless days.
Saying that, I do have another problem. I would like to pass a URL variable to the success redirect page when users login. I want to have a recordset on the login page that retrieves an issueid for the most current article and then passes it on the URL to the page that is loaded when a user successfully logins. I have tried adding the recordset to the login page and then changing the URL for the successful redirect on the tNG_config.inc.php file to:
$tNG_login_config_redirect_success["5"] = 'dashboard_issue.php?issueid=' . $currentIssueId . '';
but it isn't working. I have a tried as many variations of that syntax as I could think of or find searching online but still no luck. There might be a much easier way to do this but the way the dashboard_issue page is set up is that it is looking for the issueid in the url. The benefit being that the same page can be used for any issue that the user wants to change to once he is logged in.
I hope this is making some sense. If not please let me know.
Thanks!
-DanThe most current issue is actually just the one that is closest to today's date in the future. Users are free to add as many issues as they want in the past and future so I really can't go by issueid to sort since it might come in any order. Right now I have the most current issue found with this query:
SELECT issueid, DATE_FORMAT(date, '%W, %M %d, %Y') 'date' FROM issues WHERE date >= CURDATE() LIMIT 0,1
I will try to explain the problem a little more. This works great for what I need to do for this page as soon as they log in since it doesn't even look at the URL at all. If a user wants to go to a different issue I display a different page (which is this page just renamed) where the recordset looks at the URL issueid variable instead of the most recent issue recordset. The problem with this setup is that it is hard to maintain 2 pages all the time and would be great if I can just have one page to handle everything.
Is it possible to do something like this?:
IF issueid url variable EXISTS THEN use recordset1
IF issueid url variable DOES NOT EXISTS use recordset2
with recordset1 being the one that grabs the most current issue and recordset2 being the one that pulls the issue information based on the url issueid. -
Need some clarifyication on the header variable login module
Hi ,
I need some clarification on this Header login Module.
It checks for the Header variable sent by IIS a server, when we implement the single sign on from windows system .
1. Is HEADER variable differnet from HTTP header
2. can we use this login module if we have to check the user id in HTTPheader?
3.In my case the header variable(rEmote_user) will not be set by the IIS as i am not doing the windows authentication. can i set the the header variable(rEMOTE_USER)from asp pages and configure the Header variable login module on the portal to enable single sign on from asp application to the portal?
please write to me if you know anything on this.
Thanks,
LakshmiHi Lakshmi,
Header Login Module checks the HTTP headers for the header varible specified in the Header Login Module. In your case it is "remote_user".
> 1. Is HEADER variable differnet from HTTP header
No. Header variable is nothing but HTTP header variable.
> 2. can we use this login module if we have to check
> the user id in HTTPheader?
>
Yes. Portal looks for the user_id in the remote_user header varible.
> 3.In my case the header variable(rEmote_user) will
> not be set by the IIS as i am not doing the windows
> authentication. can i set the the header
> variable(rEMOTE_USER)from asp pages and configure the
> Header variable login module on the portal to enable
> single sign on from asp application to the portal?
>
Here is the hack. Before you set the http header varible through the asp page, what kind of mechanism you are using to ensure this is the authenticated user. Technically you can make it work. Without properly prtotecting the portal, if you simply configure the portal to accept the header variable then it could be a security risk. Anybody can simply set a HTTP header varible with the userid and access as that user.
I am just mentioning the security risk but I assume that you may have other mechanisms in place to ensure proper authentication before setting the header varibles..
> please write to me if you know anything on this.
>
> Thanks,
> Lakshmi
Hope this helps.
Regards
-Venkat Malempati -
How to set and pass a Header Varible in Jsp
Hi ,
I am using Headervariable login module(which takes user id form http header variable) for single sign on.
I configured the login module stack. But to test i need a jsp from which i can pass the user id in http header.
to test if i am able to set the user id in http header , i have written 2 jsps
1. Header.jsp
In this , i am setting the user id
response.addHeader("UserId" ,"user1");
and i am posting it to HeaderResult.jsp
2.HeaderResult.jsp
In this, i am tryng to rretrieve it By using
request.getHeader("UserId");
But i am not geeting any value.
Can i set user defined header variables?if not, can i set the standard http header variabes,
Please help me with the code.
Thanks,
LakshmiHi Deltev,
Yes it will be lost, should i use request.servervariable(Http_userid)?
The Headeresult.jsp is only to test if i am able to set the header .
Actaully ,from Header.jsp i am calling the portal(Login module stack configured to HeaderVaribleLogin).
the poratl expects the userid from Http Header from jsp i need to send this in header.
How do i do this. I am missing something while passing the userid in header.
Please lete me know.
Thanks,
Lakshmi -
ObRequestedUrl header variable missing!
Hello,
I'm trying to figure out why the ObRequestedUrl is missing from the HTTP header of my login form. The form is behind an SunOne 6.1, 32-bit web server running on Solaris. I've got the authentication scheme configured for "passthrough:yes". But the target URL (the 'action' parameter) never sees the ObRequestedURL header value!
I'm fairly sure it's not a problem with the authentication scheme configuration, because I've got a very similar form set up on an Apache 2, Linux web server that works fine.
Has anyone else seen this??
Thanks,
- Jim
Edited by: user3982020 on Jan 15, 2010 7:43 AM
Edited by: user3982020 on Jan 15, 2010 7:44 AMHi,
obrequestedurl is usually set as a header variable (so seen server-side only), but it seems that it is an intended (though undocumented) side-effect of the SlowLoginForm:true setting is that its contents are instead placed in a cookie - something to do with SlowLoginForm telling the web server that it is not sending anything other than the credentials in POST data, so it has to store the requested url somewhere. As I understand it, SlowLoginForm is not required for solving the performance issue (the web server polling for extra POST data) in recent versions of the web server. I'm not sure how helpful this is, and I don't know why you're not seeing the obrequestedurl as a header variable when the SlowLoginForm parameter is not set - this could be a bug, or perhaps a limitation with the web server API that the WebGate is using.
As you've got this working with Apache, could you send all your authentication requests to an Apache web server via the Challenge Redirect parameter?
Regards,
Colin
Edited by: user497666 on Jan 19, 2010 3:36 PM -
Header variable: Content Disposition for downloading file over HTTP?
Hi All,
I have a general content server question...Is there anyway to pass a parameter or set a setting on the content server to send the file with the header variable content-disposition set so that when a user selects a file within a browser, it doesn't open in place but asks the user whether they want to open or save the document?
Note - I'm actually using this with ArchiveLink and displaying the link in the Portal but this forum seems the closest I can get to asking this question.
Regards,
MattThanks Athol.
Although there's quite a bit of configuration options there for displaying files, there doesn't appear to be anything that let's you manipulate the HTTP header variables to set content-disposition.
Any other ideas?
Cheers,
Matt
ps. If you want to artificially see the behaviour I'm after, within IIS, you can predefine this header variable for the contentserver.dll but this makes every HTTP request act like a file that wants to be downloaded, and it calls every file contentserver.<suffix>. From a user perspective, there's nothing worse than a document opening in place in your window (losing the underlying application), or within another IE window, hence why I'd like it to act like a file download. -
Want to pass Applet form variables without showing it on URL Location
I am running one applet with some form variables. After submit I want to pass those to .asp file to store into database.
If I use URL method then all are getting displayed on URL location of browser which I do not want. I want to pass many form variables to another .asp file, so it may not be good also.
What is the best way of doing it ? Need urgent help about it.I tried following code using URL Connection Object, Code is running fine in IE and Appletviewer, but not running in Netscape.
Following is the code:
There is an applet with form. After Submit button, The form variables will be send to ASP script where I am storing it into database. In Netscape the server connection is made (blank record is getting created) but data is not passed.
public void actionPerformed(ActionEvent event) {
try{
ByteArrayOutputStream byteStream = new ByteArrayOutputStream(512);
PrintWriter out = new PrintWriter(byteStream, true);
String postData = "firstName=manisha";
out.print(postData);
out.flush();
URL dataURL = new URL("http://manisha/appletexamples/confirm-px.asp");
URLConnection connection = dataURL.openConnection();
connection.setUseCaches(false);
connection.setDoOutput(true);
String lengthString = String.valueOf(byteStream.size());
connection.setRequestProperty ("Content-Length", lengthString);
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
byteStream.writeTo(connection.getOutputStream());
BufferedReader in =
new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
while((line = in.readLine()) != null) {
System.out.println("line: " + line);
} //while
in.close();
} //try
catch(Exception e){}//catch
}//action performed
My ASP Code
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open("DATABASE=phptestdb;DSN=phptestdsn")
%>
<HTML>
<HEAD>
<TITLE> A Sample Program </TITLE>
</HEAD>
<BODY>
<%DIM fname
fname = ""
fname = Request("firstName")
response.write ("fname : " & fname)
qrystr1 = "insert into applettesttable (fname) values ('" & fname & "')"
conn.Execute qrystr1
conn.Close
Set conn = Nothing
%>
</BODY>
</HTML> -
Passing Cookies from Previous Web HTTP Request to the Next
Hi,
I have two Web Http Requests. The first one performs a Login and the second one executes another method called ListRecoveryPlans.
First SOAP calls for Login looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap-url>https://srm-app-003:9007</soap-url>
<connection>
<name>srm_connection_test_01</name>
<terminate-on-exit>false</terminate-on-exit>
</connection>
<SOAP-ENV:Body>
<urn:SrmLogin xmlns:urn="urn:srm0">
<urn:_this xmlns:urn="urn" type="SrmApi">Srm</urn:_this>
<urn:username>cisco\xxx</urn:username>
<urn:password>xxx</urn:password>
</urn:SrmLogin>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The second soap looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap-url>https://srm-app-003:9007</soap-url>
<connection>
<name>srm_connection_test_01</name>
<terminate-on-exit>false</terminate-on-exit>
</connection>
<connectionCookie>
<name>
<xsl:text disable-output-escaping="no">DE78D964-DDF4-40B6-BCB7-BEB44624826D</xsl:text>
</name>
</connectionCookie>
<SOAP-ENV:Body>
<urn:ListRecoveryPlans xmlns:urn="urn:srm0">
<urn:_this xmlns:urn="urn" type="SrmApi">
<xsl:text disable-output-escaping="no">Srm</xsl:text>
</urn:_this>
</urn:ListRecoveryPlans>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
In addition, under the Cookies tab for the ListRecoveryPlans request, I passed the cookies from the previous request:
However, I am getting a "session is not authenticated" error.
The remote server returned an error: (500) Internal Server Error.
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault><faultcode>ServerFaultCode</faultcode><faultstring>The session is not authenticated.</faultstring><detail><SecurityErrorFault xmlns="urn:srm0" xsi:type="SecurityError"></SecurityErrorFault></detail></soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Can you shed some light on how I can fix this issue? I am using CPO v. 2.2.0.1409.
Thank you.
Regards,
Mary Jane CofinoHi,
Thank you for the prompt reply.
For the first request, here is the response header I am getting
I checked the "Accept cookies from this request" checkbox button and am now getting a new error:
The remote server returned an error: (500) Internal Server Error.
<?xml version="1.0" encoding="UTF-8"?>
http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
ServerFaultCodeThe object has already been deleted or has not been completely created
Regards,
Mary Jane Cofino -
How to pass a JavaScript variable into a java method
I would like to know how to pass a JavaScript variable into a java method with in a <% %> tag inside a JSP file like so:
<%@ page contentType="text/html;charset=windows-1252"%>
<html>
<head>
<script LANGUAGE="JavaScript">
myValue = someDynamicValue;
<% System.out.println(myValue)%>
</script>
</head>
<body>
</body>
</html>
obviously "System.out.println(myValue)" will not work because myValue is seen as a java variable and not a JavaScript variable.
I would like to know how to let the jsp file, that I wrote in the above code, see myValue as a JavaScript variable and not a java variable so that I can pass it to a java method.
NOTE: the java method does not have to be a println() method, it can be any method of my choice.
NOTE: someDynamicValue is a JavaScript value that can dynamically changeI don't believe you can. JSPs are really just elaborate templates that an engine such as Tomcat parses and generates an HTML page based on. That page is then displayed to the user. By the time you want to use some function in Javascript, the JSP has already been parsed and generated.
Basically, Javascript and JSPs can't talk to each other. One's server-side and the other is client-side. -
File information -- How to retrieve file name from header variable
Hi
I am using File Adapters to read files(.xml) and then I need to perform some database operations.
One of the requirement is storing the file name read into the DB.
I searched through the forum and got the information on how to configure this in the header variable. The link below shows the same.
File Adapter
Now, I use the XSL mapper to map the source values(from input xml file) to the corresponding table column names. So how should I get the value of the file name.
I saw some of the in-built functions to be used for this but there is not enough documentation to proceed.
Can anyone please provide some solution on this.
/Kiran.Hi,
Here are the steps that you need to do after you have declared the variable.
1) The variable that you have declared should have the following elements
a) Filename
b) Directory
2) Use the assign activity to copy the value of the filename part of this variable to the arg that needs to be passed to the database. (most probably an invoke variable).
If you still have any problems implementing this, mail me at [email protected]..and i'll send you the screen shots for the entire process.
ciao,
Gunjan
Maybe you are looking for
-
Anyone had a problem with the on/off button or sleep/awake button becoming difficult to push
the button has become stiff or maybe its broke...if you push hard enough it still works but you have to take the protective cover on an off which is a hassle
-
Installing SSD in Pavilion P7-1220
Hello I am taking a Samsung 1TB SSD w' Win 8.1 and additional data on it from my current HP Envy Phoenix 160-810 and replacing it with a different drive. My question is that I want to transfer the Samsung SSD 1TB Win 8.1 to my older Pavilion P7-1220
-
I want to give my friend a video file, so when he imports it into avid, premiere, final cut etc. he would recieve 6 mono tracks (L,R,C,LE,Ls,Rs) and the last one to be stereo. but every time i export it comes as 7 mono tracks. and in the setting that
-
Many Items in the PR created by MRP
Dear Experts, When I run the MRP .. alot of PRs created .. even if i'm gona convert a lot of PRs to just one Purchase order How can I make the PR created by the MRP contain a lot of item In another way how can I make a whole BOM contents be in one PR
-
WebUtil - File Transfer to File Server instead of App Server of DB
Is it possible to upload a file to server other than the db server or app server? Thanks.