How do I get the client IP Address from the HTTPServletRequest object
Hi ppl,
How do I get the IP address of the client machine from the HTTPServletRequest object?
Thnx in advance,
Manoj
Take a look at: http://java.sun.com/products/servlet/2.2/javadoc/index.html and check for the ServletRequest Interface.
Be aware also if your web server is using proxy, proxyReverse and so because you could end getting the servers' IP and not client one.
Similar Messages
-
HT201320 how do I get my e-mail addresses from my mac to my iphone
how do I get my e-mail addresses from my mac to my iphone 5?
Either click here and follow the instructions, or follow those in the article you asked this question from and then sync the iPhone with that iTunes library.
(82400) -
How to get the HttpServletRequest object in a jsp
Hi,
I am a little confused here. Am trying to use the HttpServletRequest object in my jsp. I have set up just a simple test page jsp. How can i use the HttpServletRequest object to get some information about the request for example using the method getPathInfo(). I know i can do this in a servlet and pass the value as a parameter in a doGet method. But how do i do it in a jsp. Can it be done..?
Pls help
ThankyouThe request object is already created for you in JSP, as are many other things
request - the HttpServletRequest object
response - the HttpServletResponse object
session - the HttpSession object
application - the ServletContext object
out - the JspWriter object (like PrintWriter)
So you just use them...
<%
String asdf = request.getParameter("asdf");
%> -
Can I get the HttpServletRequest object in my custom auth providers?
Hello -
If I write a custom authentication or identity assertion provider, is there a way to get the HttpServletRequest object of the user's request?
Thanks,
-- ScottYou can do it from your identity asserter in the following way!
public CallbackHandler assertIdentity(String type, Object token, ContextHandler context) throws IdentityAssertionException
Object requestValue = context.getValue("com.bea.contextelement.servlet.HttpServletRequest");
HttpServletRequest request = (HttpServletRequest) requestValue;
-Faisal
http://www.weblogic-wonders.com -
How can I get the underlying object from the ObjectReference
Dear friends,
I think this question has been asked a couple of times. But, I am still wondering if anybody has found an answer to it. Maybe this is some common need ...
I would like to get the underlying object for which the ObjectReference is
a mirror For example, I have a class Customer in my application, and I can get an ObjectReference through JDI during runtime. But how can I get the target VM's object which is a real instance of Customer, by which I can invoke methods defined in Customer?
Thank you so much for any input!
SunnyDayI'll preface this response by admitting this far from an elegant solution, but I did write a function addressing this question, mostly as an exercise.
If passed an object with an InTextFrame property (Pgf, AFrame, Cell, Fn) that resides in an open document, the function will return the Doc object. Otherwise, it returns undefined.
function getParentDoc(testObj) {
//Get object for current page
try { var curPage = testObj.InTextFrame.FrameParent.PageFramePage; }
catch(er) {return;}
//Step backwards to first page in document
var prevPage = curPage.PagePrev;
while (prevPage.ObjectValid())
curPage = prevPage;
prevPage = prevPage.PagePrev;
//Compare with first pages of open documents
var testDoc = app.FirstOpenDoc;
while (testDoc.ObjectValid())
if (curPage.id==testDoc.FirstBodyPageInDoc.id) return testDoc;
testDoc = testDoc.NextOpenDocInSession;
return;
To your PPS: Rather than seeing the native framework grow bloated to address additional features, I would love to see Adobe and other developers publish libraries of useful functions and class extensions. -
How can I get the "pageContext" object in jsp page?
Hi everyone:
I want to get struts's DataSource object in jsp page.So I should get the PageContext object in jsp page.My code is:
///////////////////datatest.jsp///////////////////////////////////
DataSource ds=(DataSource)pageContext.getAttribute(Action.DATA_SOURCE_KEY);
conn=ds.getConnection();
stm=conn.createStatement();
rs=stm.executeQuery(insertsql);
Is right?But I get the "NullPointerException" error in Tomcat.The connection pool in struts-config.xml is:
<data-sources>
<data-source key="mydatasource">
<set-property property="autoCommit"
value="false"/>
<set-property property="description"
value="MyWebSite Data Source Configuration"/>
<set-property property="driverClass"
value="org.gjt.mm.mysql.Driver"/>
<set-property property="maxCount"
value="4"/>
<set-property property="minCount"
value="2"/>
<set-property property="password"
value="qijiashe"/>
<set-property property="url"
value="jdbc:mysql://localhost:3306/myweb"/>
<set-property property="user"
value="lyo"/>
</data-source>
</data-sources>
I can query the database in servlet.
I think the method that I get the context is not right.Had someone get the pagecontext in jsp page?help :(Sorry I forgot that I had change the code:
DataSource ds=(DataSource)pageContext.getAttribute(Action.DATA_SOURCE_KEY);
conn=ds.getConnection();
stm=conn.createStatement();
rs=stm.executeQuery(insertsql);
to the code:
DataSource ds=(DataSource)pageContext.getAttribute("mydatasource");
conn=ds.getConnection();
stm=conn.createStatement();
rs=stm.executeQuery(insertsql);
mydatasource is the struts datasource in "struts-config.xml". I couldn't work -
How do I get date and time component from a DATE object?
Hi All,
I need to get date and time separately from a DATE object, does
anyone know what function I should call? GetDate()? GetTime()?
I need this in a SELECT statement.
Thanks in advance and looking forward to your early reply.
Regards.
Gladywin
30/11/2001Hello,
See following SQL.
select to_char(sysdate,'dd/mm/rrrr') today_date,
to_char(sysdate,'hh24:mi') now_time
from dual
Adi -
How can I get the Doc object from any other object?
Dear colleagues,
in FrameScript it is dead-simple to get to the document part of any object, just add .Doc to the variable.
How can I achieve the same with ExtendScript? I amtired of passing the document object next to AFrames or Pgfs along into subroutines, because those objects already contain the information about their document. But how do I access this?
Thanks for pointers,
- Michael
PS: Almost the same is true for the page an object lives on. With FrameScript we use .Page, with ExtendScript you have to move up the object tree until you reach the UnanchoredFrame.PageFramePage…
PPS: It would be great to see some convenience properties like .Doc and .Page implemented natively.I'll preface this response by admitting this far from an elegant solution, but I did write a function addressing this question, mostly as an exercise.
If passed an object with an InTextFrame property (Pgf, AFrame, Cell, Fn) that resides in an open document, the function will return the Doc object. Otherwise, it returns undefined.
function getParentDoc(testObj) {
//Get object for current page
try { var curPage = testObj.InTextFrame.FrameParent.PageFramePage; }
catch(er) {return;}
//Step backwards to first page in document
var prevPage = curPage.PagePrev;
while (prevPage.ObjectValid())
curPage = prevPage;
prevPage = prevPage.PagePrev;
//Compare with first pages of open documents
var testDoc = app.FirstOpenDoc;
while (testDoc.ObjectValid())
if (curPage.id==testDoc.FirstBodyPageInDoc.id) return testDoc;
testDoc = testDoc.NextOpenDocInSession;
return;
To your PPS: Rather than seeing the native framework grow bloated to address additional features, I would love to see Adobe and other developers publish libraries of useful functions and class extensions. -
How do I get My e-email addresses from my phone into windows mail
My comp died. Had to reformat. Is there a way to retrieve all my e-mail addresses from the I-phone and get them back to windows mail. Not contacts!! I dont need all the phone #s. From the phone, put in windows mail If you know what I mean. Thanks Bill
Message was edited by: cowbell billNo, I don't think so. On my iPad, the other two accounts are:
1. [email protected] POP account HostName incoming.verizon.net Outgoing I use smtp.me.com
2. [email protected] IMAP account Host Name mail.webfaction.com HOWEVER, this account already is forwarded to my .mac account, so probably should work
Does this information help? -
Is there inbuild Handler in weblogic using which i can get the MessageContext object
HI,
I need MessageContext object in my application but i dont want to use the Handler,As
there is AxisEngine in axis soap engine,is there any similar implementation in
weblogic.
AxisEngine.getCurrentMessageContext() we can get the MessageContext what about
in weblogic..any body any idea???
Regards,
Akhil NagpalHI,
yeah i had to make use of Handler to get the MessageContext object and play with
that.
Thanks & Regards
Akhil Nagpal
"manoj cheenath" <[email protected]> wrote:
You can get to MessageContext from a handler. Check out an example of
handler
to see how you can get Message out of MessageContext.
-manoj
"Akhil Nagpal" <[email protected]> wrote in message
news:[email protected]..
HI manoj,
Thanks for your reply.otherwise i thought that i wont get any morehelp
on this
forum :-) ...
anyway its good that we will have such thing in next version,duringthe
development
i feel that more functioanlity should be in build in appserver. Likeone
more
thing i could not find out is how we can get the "message" object inweblogic
like we can in axis using its MessageContext class's static method.if it
is there
can you please let me knwo about that.
The other problem i had to make use of handler and my appl is workingas of
now :-)
Regards
Akhil Nagpal
"manoj cheenath" <[email protected]> wrote:
You can not do this in WLS 7.0. The next major release (WLS 8.1) will
fix
this problem.
-manoj
"Akhil Nagpal" <[email protected]> wrote in message
news:[email protected]..
HI,
I need MessageContext object in my application but i dont want
to
use
the Handler,As
there is AxisEngine in axis soap engine,is there any similarimplementation in
weblogic.
AxisEngine.getCurrentMessageContext() we can get the MessageContextwhat
about
in weblogic..any body any idea???
Regards,
Akhil Nagpal -
Getting the connection object in graph
As part of Denormalizer component's Denormalize property where we have the logic of collapsing/denormalising the records we want to execute a sql query using PreparedStatement which requires Connection object.how do I get the connection object and execute a query.Can some one please share the java doc of the classes I can use.
Do I get any class under org.jetel package which can be useful to get the Connection object.As part of Denormalizer component's Denormalize property where we have the logic of collapsing/denormalising the records we want to execute a sql query using PreparedStatement which requires Connection object.how do I get the connection object and execute a query.Can some one please share the java doc of the classes I can use.
Do I get any class under org.jetel package which can be useful to get the Connection object. -
Whenever I update my iPhone software, it asks me to sign in to iCloud with an old email address. My other devices all have the correct address. How can I get the correct address for my iPhone? The only Apple ID that works for logging in is my new one.
To change the iCloud ID you have to go to Settings>iCloud, tap Delete Account, provide the password for the old ID when prompted to turn off Find My iPhone (if you're using iOS 7), then sign back in with the ID you wish to use. If you don't know the password for your old ID, or if it isn't accepted, go to https//appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID. Tap edit next to the primary email account, tap Edit, change it back to your old email address and save the change. Then edit the name of the account to change it back to your old email address. You can now use your current password to turn off Find My iPhone on your device, even though it prompts you for the password for your old account ID. Then go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud). Next, go back to https//appleid.apple.com and change your primary email address and iCloud ID name back to the way it was. Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.
-
How can i get the SMTP IP address for gmail
Hello,
sapian,
I want to schedule a webi document through BI Launch Pad to users email address gmail.So while configuring the AdaptiveJobServer in CMC i need to give SMTP details such as
Domain name:
Host:
Port:
So for scheduling a webi document to a gmail user i need the above details for gmail SMTP server.Can any one suggest me how can i get the above details for gmail SMTP server.
Thanks in advance.
Regards,
Kishor Kumar SHi Hrishikesh,
i have configured the 'stunnel.conf' file with the following details
accept =static ip address of the machine colon port number where the stunnel is installed
connect = smtp.gmail.com:465
and i saved the file.
when i go to
Start->Stunnel->service install
it is giving error as follows
Error binding ssmtp to (ip address and port number which i have given in stunnel.conf file 'accept')
bind: No error (0)
Can you suggest me the solution for the above error.
Thanks in advance,
Regards,
Kishor -
How can I get the MAC address of my Apple TV?
How can I get the MAC address of my Apple TV? I currently do not have an HDMI device to connect it to, and the MAC is not listed on the box or the Apple TV itself.
(to answer the obvious, I am trying to pair it with an iPad, and I need to register the Apple TV for the network so the two can see each other)As long as I know java doesn't have support to work on link-layer, only internet and transport layers. You may write simple native code. On windows, IP Helper functions, like SendARP allow you to pass an IP address and get the hardware address. You store the hardware address on your database/file and later, when that machine is off, you send a frame to the address you stored previous.
[http://msdn.microsoft.com/en-us/library/aa366071(VS.85).aspx]
I haven't seen it on Linux, but if you need help let me know I'll check the Linux API's too. -
I got a $25 itunes gift card and tried to redeem it on my regular itunes apple ID account and I had a message saying the code was invalid so I made a new account and redeemed it on that account but it doesnt have a valid email address and I cant even remember what it was how do I get the credit from wherever it is onto my regular itunes apple ID account?
Qauzzy, The credit was applied to the account you used at the time you redeemed the card. There is no way to transfer the credit to another account.
You might as well just spend the $25 on the new account, and then stop using it and go back to your regular account..
For future reference, do not start a new account just because you have a problem with the code. Rather, follow the suggestions in this document: iTunes Store: Invalid, inactive, or illegible codes
Maybe you are looking for
-
Hey! I need some help with my iphone and itunes. The problem is, that I formated my computer, and now, when I connect my iphone and cant really do anything with my iphone because it says that my iphone is synchronized with another Itunes-library (the
-
Hi I was just wondering if there will be a BIOS update for the H520s that will allow me to have both onboard and external graphics enabled. Cheers!
-
Does it work outside of the US?
I would like to know it the Airport Extreme works outside the US, and is it a monthly charge or what?
-
How to make inline format command carry over to subsequent pages
Using Designer 5.7. Using inline formatting in the data file (\b. \b0.) to make part of the text bold (Example: bold text bold text regular text). The problem occurs when the end of page is reached. The text flows to the next page and if the text
-
Constant Selections and Exception Aggregation
Hi, Can You please tell me 1) what is constant selections? 2) what is Exception Aggregations? Thanks and Regards. Naresh.