Hi Michel,
named arguments are now first class citizens. Try this:
<args>
<myarg>$1</myarg>
</args>
The method request.getArg(unsigned) should not be used. Named arguments
are just so much better.
Tommi
Am 04.02.2014 09:19, schrieb Jean-Michel Caricand:
Hello,
I have another problem. In my application, I use request.getArg()
fonction. It doesn't work with the latest :
My T2.ecpp component :
<%pre>
// put your includes here
// #include "foo.h"
</%pre>
<%args>
// define the query parameters
// bar;
</%args>
<%session>
// define your session scope variables here
// std::string mySessionState;
</%session>
<%cpp>
// put your C++ code here
</%cpp>
<!DOCTYPE html>
<html>
<head>
<title>ecpp application T1</title>
</head>
<body>
<h1>T2</h1>
<p>Hello world from T2!</p>
% log_error("MYARG : " << request.getArg("myarg"));
</body>
</html>
In tntnet.xml :
...
<mapping>
<target>$1@T1</target>
<url>^/([^.]+)(\..+)?</url>
</mapping>
<mapping>
<url>^/T2/([0-9]+)/.*$</url>
<method>GET</method>
<target>T2@T1</target>
<args>
<arg>myarg=$1</arg>
</args>
</mapping>
</mappings>
...
My logs :
jm@amande:~/T1$ make test
tntnet tntnet.xml
2014-02-04 08:59:07.33417 [30525.47319590357184] INFO tntnet.listener -
listen ip= port=8000
2014-02-04 08:59:07.33429 [30525.47319590357184] INFO tntnet.tntnet -
create 5 worker threads
2014-02-04 08:59:15.68543 [30525.47319600879360] INFO tntnet.worker -
request GET /T2/12/test from client 127.0.0.1 user-Agent "Mozilla/5.0
(X11; Ubuntu; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0" user ""
2014-02-04 08:59:15.68566 [30525.47319600879360] INFO tntnet.comploader
- load library "T1"
2014-02-04 08:59:15.68601 [30525.47319600879360] INFO tntnet.comploader
- library "./T1.so"
2014-02-04 08:59:15.68626 [30525.47319600879360] ERROR component.T2 -
MYARG :
2014-02-04 08:59:15.68628 [30525.47319600879360] INFO tntnet.worker -
request GET /T2/12/test ready, returncode 200 OK - ContentSize: 146
Jean-Michel
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general