[opencms-dev] Can't find params in request object
Cyrill Brunschwiler
cbrunsch at hsr.ch
Tue Jul 27 20:02:01 CEST 2004
Hi Philip
I'm not sure but try to request your page by IP rather than localhost.
regards
Cyrill
On Tuesday 27 July 2004 12.54, Philip wrote:
> Hi there Cyrill,
>
> I've done what you said. This really should be the answer, I'm just not
> hitting the right combination of settings just yet, I think. If I may, I'm
> going to detail how I've created a test that I can't get to work and maybe
> you'll see the problem. I'm just doing this so that I can do what I want
> to do with a bit of knowledge before I stumble through my own project.
>
> My first iteration:
>
> I created a template files:
> 1. security_template.jsp
> 2. navigation.jsp (included in security_template.jsp in the head section
> and includes a timestamp for testing)
>
> Properties for both:
> export:false
> (nothing for cache in this iteration)
>
> 3. test.jsp, which uses the head and foot of the template
> Properties:
> export:false
> (also nothing for cache in the test iteration)
>
> After publishing, the result is that I can see the page at:
> http://localhost:8080/opencms/opencms/www/photoalbum/test.jsp
>
> However, the timestamp updates with each refresh.
>
> Then, I added the following properties to navigation.jsp:
> cache:uri (also tried uri:timeout=1)
>
> No difference.
> Then, I added the following properties to the template and to test.jsp:
> cache:uri (also tried uri:timeout=1)
>
> Again, no difference. The timestamp updates no matter what I do.
>
> So, I'm confused. Any thoughts about what I could be missing?
>
> Thanks!
> Philip
>
> -----Original Message-----
> From: opencms-dev-admin at opencms.org [mailto:opencms-dev-admin at opencms.org]
> On Behalf Of Cyrill Brunschwiler
> Sent: Tuesday, July 27, 2004 4:47 PM
> To: opencms-dev at opencms.org
> Subject: Re: [opencms-dev] Can't find params in request object
>
> Hi Philip
>
> Set a propety named export to false. The export and caching features of
> opencms are explained in the documentation. You should take a quick glance
> at the paper!
>
> regards,
> Cyrill
>
> On Monday 26 July 2004 12.06, Philip wrote:
> > Ok,
> >
> > The reason it wasn't working is because my page was an .html page.
> > So, even though the page was created with a template that had dynamic
> > elements in it, it wasn’t actually dynamic because it was exported as
> > an .html flat file.
> >
> > Now I know what's going on, but I still need a "best practice" for the
> > solution.
> >
> > Basically, I want to have a login process that is included in the
>
> template.
>
> > So, there'll either be a message like:
> > "You are logged in as Joe"
> >
> > Or, if guest is logged in, just display a login/password form. I had
> > the login logic in my template, but since the file is actually
> > exported as an .html file, it obviously can't do anything dynamic.
> >
> > So, do I have to make all of my pages .jsp pages, or is there a better
>
> way?
>
> > Ultimately, I want to implement some degree of access control over
> > which pages can be viewed by Guest and which pages can be viewed only
> > by logged-in users.
> >
> > Thanks again for your help.
> >
> > Regards,
> > Philip
> >
> > -----Original Message-----
> > From: opencms-dev-admin at opencms.org
> > [mailto:opencms-dev-admin at opencms.org]
> > On Behalf Of Arian Abrahantes Quintana
> > Sent: Monday, July 26, 2004 3:45 PM
> > To: opencms-dev at opencms.org
> > Subject: Re: [opencms-dev] Can't find params in request object
> >
> > Hi,
> >
> > First of all, I am beginner. So... When I am working on the workplace
> > session, I also had this kind of problem. Seems to be that there is
> > some interference when the workplace session is open and the method
> > "request.getParameter" is called (at least for login, username,
> > password and logout) but it vanishes as soon as I am loged out of the
> > workplace session.
> >
> > hope this help or heat the forum ;)
> >
> > best regards,
> >
> > arian
> >
> > Philip wrote:
> > >Hi there,
> > >
> > >For some reason, I can't find the parameters from a form that I'm
> > >testing in my request object.
> > >
> > >I'm accessing the request object in my template and using the
> > >template for an html file.
> > >
> > >The only parameters that I can find in the request object are:
> > >element: _flex_export_body
> > >element: _flex_export
> > >element: _flex_export_encoding
> > >
> > >It doesn't seem to matter whether this page is being submitted to or
> > >not, I get only those params.
> > >
> > >---------------Here's the code:
> > ><%
> > > // create a JSP action element
> > > CmsJspActionElement cms = new CmsJspActionElement(pageContext,
> > >request, response);
> > > CmsObject cmsObject = cms.getCmsObject();
> > > out.println(request.getParameter("login")); // this produces
> > >null, no matter what
> > > Enumeration params = request.getParameterNames();
> > > while (params.hasMoreElements()) {
> > > out.println("element: " + params.nextElement() + "<br/>");
> > > }
> > > if (request.getParameter("login") != null) { //This block is
> > >never run as the param is always null
> > > //out.println("It was not null!");
> > > String username = request.getParameter("username");
> > > String password = request.getParameter("password");
> > > out.println("About to log user in with " + username + " " +
> > >password);
> > > if (username != null && password != null)
> > > cmsObject.loginUser(username, password);
> > > }
> > >
> > >%>
> > >---------------End of code
> > >
> > >I'm using OpenCMS 5.0.1 on Redhat 7.3
> > >
> > >If anyone has any thoughts, I'd really appreciate it.
> > >
> > >Thanks!
> > >Philip
> > >
> > >
> > >_______________________________________________
> > >This mail is send to you from the opencms-dev mailing list To change
> > >your list options, or to unsubscribe from the list, please visit
> > >http://mail.opencms.org/mailman/listinfo/opencms-dev
> >
> > _______________________________________________
> > This mail is send to you from the opencms-dev mailing list To change
> > your list options, or to unsubscribe from the list, please visit
> > http://mail.opencms.org/mailman/listinfo/opencms-dev
> >
> >
> > _______________________________________________
> > This mail is send to you from the opencms-dev mailing list To change
> > your list options, or to unsubscribe from the list, please visit
> > http://mail.opencms.org/mailman/listinfo/opencms-dev
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list To change your
> list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
>
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
More information about the opencms-dev
mailing list