my dog learned polymorphism*
The moose likes Struts and the fly likes HTTp Request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "HTTp Request" Watch "HTTp Request" New topic
Author

HTTp Request

Singh gurpreet
Greenhorn

Joined: Apr 07, 2008
Posts: 3
Hi all,


I need http request in non-httpreuqest aware class.

I mean for example i have a class

public class XYZ{

public String getMessage(String key){
//I Need request object here . Actually this method is called by some framework and i dont want to pass request object as input parameter to this method.
}
}


Is there any way , i can get HttpRequest object in this method.

Thanks in advance.




Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41108
    
  45
Hello "preetdude"-

Welcome to JavaRanch.

On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do using the "My Profile" link at the top of the page.

As to your question, what framework is this? Most web frameworks provide a way to make the request object available where it is needed. Have you checked the documentation of whichever one you're using?


Ping & DNS - my free Android networking tools app
Singh gurpreet
Greenhorn

Joined: Apr 07, 2008
Posts: 3
i am using Struts framework, and that method is called by a TLD (<bean:message key="lable.name"/>


public class HAZMessageResources extends MessageResources {

.................................
...............................


public String getMessage(Locale locale, String key) {


// TODO - Remove this hard coding, get clientId from some process
String clientId = //look into request to see client Id

}

}


Singh gurpreet
Greenhorn

Joined: Apr 07, 2008
Posts: 3
Any idea about this....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTp Request
 
Similar Threads
Method Overriding confusion
Method Overriding confusion
Question about servlet filters
HTTP object?
Why does getParameterMap() return an *immutable* Map?