cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <h...@dvs1.informatik.tu-darmstadt.de>
Subject Re: How to Obtain HttpRequest interface in 2.0.2 ?
Date Tue, 02 Jul 2002 07:23:25 GMT
On 02.Jul.2002 -- 11:28 AM, Jason Uithol wrote:
> We have upgraded from Cocoon 2.0.1 to Cocoon 2.0.2
> 
> One of our transformers can no longer handle internal requests.  The code
> that fails is:
> 
> public void setup(SourceResolver resolver, Map objectModel, String src,
> Parameters par)
>   throws SAXException, ProcessingException, IOException
> {
>     Request request = (Request) objectModel.get(Constants.REQUEST_OBJECT);
> 
>     // This line here gets a ClassCastException.
>     HttpRequest hreq = (HttpRequest)request;
> 
>     Session session = hreq.getSession();
> 
>     Context context = (Context)objectModel.get(Constants.CONTEXT_OBJECT);
> 
>     handler.setInputs(session, request, context);
> }

Some constants were removed since their place was not considered
reasonable (i.e. don't belong to the core). There is a helper class
for getting the request object now:

org.apache.cocoon.environment.ObjectModelHelper

Method

public static final Request getRequest(java.util.Map objectModel)

The same is true for the context object.

	Chris.

Please follow up summarizing your problem and which suggested solution /
information worked for you. Add "SUMMARY: " to the subject line. This
will make FAQ generation and searching the list easier. In addition,
it makes helping you more fun. Thank you.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message