Param Example not working

31 views
Skip to first unread message

Sanx

unread,
May 23, 2012, 7:49:24 PM5/23/12
to Lift
Greetings to all

I'm doing some tests with the following examples:

http://simply.liftweb.net/index-3.4.html # sub: Param-Example

but I can not make it work

Someone can help me and tell me I'm doing wrong

when I put the url:

http://localhost:8080/param/xxx

I says:

The Requested URL / param / ​​xxx not was found on this server

Thanks for your attention

my project is as follows:

https://github.com/sanxelsanto/parameters

Lukasz Kuczera

unread,
May 24, 2012, 11:23:59 AM5/24/12
to lif...@googlegroups.com
I didn't spot problem, but can you describe what you want to achieve ?

Sanx

unread,
May 24, 2012, 11:47:31 AM5/24/12
to Lift
Ok, I apologize if I did not know how to explain
English is not my native language

I'll try one more time

In the url:

http://localhost:8080/param/xxx
should show the following:



Thanks for visiting this page. The parameter is xxx

Another way to get the param: xxx


But instead of showing it, says:
The Requested URL / param / ​​xxx Not Was found on this server


On 24 mayo, 10:23, Lukasz Kuczera <kuk...@gmail.com> wrote:
> I didn't spot problem, but can you describe what you want to achieve ?
>
>
>
>
>
>
>
> On Thursday, May 24, 2012 1:49:24 AM UTC+2, Sanx wrote:
>
> > Greetings to all
>
> > I'm doing some tests with the following examples:
>
> >http://simply.liftweb.net/index-3.4.html# sub: Param-Example

AGYNAMIX Torsten Uhlmann

unread,
May 24, 2012, 12:00:26 PM5/24/12
to lif...@googlegroups.com
Hi Sanx,

I think your problem is the way you enter the parameter:

http://localhost:8080/param/xxx is not a parameter, it's a URL. You can get these values also, but if you want a param, enter it like this:


Does that help?
Torsten.

-- 
AGYNAMIX(R). Passionate Software.
Inh. Torsten Uhlmann | Buchenweg 5 | 09380 Thalheim
Phone:       +49 3721 273445
Fax:             +49 3721 273446
Mobile:       +49 151 12412427
Web:           http://www.agynamix.de

Sanx

unread,
May 24, 2012, 12:24:00 PM5/24/12
to Lift
no

thanks for the reply

but it still does not work in any of the 2 ways

But as I understand the idea is to work with the url:

http://localhost:8080/param/xxx

The example is as follows:

Above, we saw how to create a Loc[ParamInfo] to capture URL
parameters. Let’s look at the /param/xxx page and see how we can
access the parameters:

param.html

<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-
type" />
<title>Param</title>
</head>
<body class="lift:content_id=main">
<div id="main" class="lift:surround?with=default;at=content">
<div>
Thanks for visiting this page. The parameter is
<span class="lift:ShowParam">???</span>.
</div>

<div>
Another way to get the param: <span class="lift:Param">???</
span>.
</div>

</div>
</body>
</html>

Param.scala

package code
package snippet

import lib._

import net.liftweb._
import util.Helpers._
import common._
import http._
import sitemap._
import java.util.Date

// capture the page parameter information
case class ParamInfo(theParam: String)

// a snippet that takes the page parameter information
class ShowParam(pi: ParamInfo) {
def render = "*" #> pi.theParam
}

object Param {
// Create a menu for /param/somedata
val menu = Menu.param[ParamInfo]("Param", "Param",
s => Full(ParamInfo(s)),
pi => pi.theParam) / "param"
lazy val loc = menu.toLoc

def render = "*" #> loc.currentValue.map(_.theParam)
}

so I do not understand where my mistake



On 24 mayo, 11:00, AGYNAMIX Torsten Uhlmann <T.Uhlm...@agynamix.de>
wrote:
> Hi Sanx,
>
> I think your problem is the way you enter the parameter:
>
> http://localhost:8080/param/xxxis not a parameter, it's a URL. You can get these values also, but if you want a param, enter it like this:
> >>>http://simply.liftweb.net/index-3.4.html#sub: Param-Example

Juan Jose Olivera

unread,
May 24, 2012, 12:35:25 PM5/24/12
to lif...@googlegroups.com
Hi Sanx, if I am not wrong you need to add Param.menu to the sitemap.



2012/5/24 Sanx <hecto...@gmail.com>



--
Juan Jose Olivera Rodriguez
Director General
Genso Iniciativas Web
+591.44505438

Sanx

unread,
May 24, 2012, 1:41:52 PM5/24/12
to Lift
yesssss!!

you're right

thank you very much for your help Juan



On 24 mayo, 11:35, Juan Jose Olivera <j...@genso.com.bo> wrote:
> Hi Sanx, if I am not wrong you need to add Param.menu to the sitemap.
>
> 2012/5/24 Sanx <hectorg...@gmail.com>
> > >http://localhost:8080/param/xxxisnot a parameter, it's a URL. You can
> *Juan Jose Olivera Rodriguez
> Director General
> Genso Iniciativas Web
> +591.44505438
> *
Reply all
Reply to author
Forward
0 new messages