Hi David, you can actually debug a csp page with the studio debugger. However, this requires a bit more preparation, as you need to identify the csp server process running your page, which is not always straightforward.
An easier approach would be to use the command line debugger in combination with the CSP shell.
SAMPLES>ZBREAK zListFiles+1^csp.menu.1
SAMPLES>d $SYSTEM.CSP.Shell()
CSP Shell
Command shell for debugging CSP pages. It looks and acts like a Cache programmer prompt, but you can use the GET or HEAD command to fetch a CSP page. You can set breakpoints, step into the code etc. You may pass query parameters to the page as well, eg.:CSP>>> GET /csp/samples/request.csp?A=1&B=2
The output you see is what would be sent to the browser, including any HTTP headers. You can also interact with the session, request and response objects via the special variables %session, %request and %response.
CSP:SAMPLES>>> get /csp/samples/menu.csp
200 OK
Content-Type: text/html; charset=utf-8
Set-Cookie: CSPSESSIONID-UP-csp-samples-=5864 5864; path=/csp/samples/; httpOnly;
Cache-Control: no-cache
Date: Wed, 09 Nov 2016 17:49:45 GMT
Expires: Thu, 29 Oct 1998 17:04:19 GMT
Pragma: no-cache
CSP Samples Menu
CSP Samples Menu
This page displays a list of available CSP pages within the same
directory.
Click this link to see a demonstration of the the Zen Web Development Framework.
Samples Menu
Source
New file,rs,dir,menupath,subdir,list,page,description,url
^
zListFiles+2^csp.menu.1
SAMPLES 15d6>
In this example I am setting the breakpoint to
ZB zListFiles+1^csp.menu.1
and then request the menu page within the CSP shell:
SAMPLES>d $SYSTEM.CSP.Shell()
CSP Shell
Command shell for debugging CSP pages. It looks and acts like a Cache programmer prompt, but you can use the GET or HEAD command to fetch a CSP page. You can set breakpoints, step into the code etc. You may pass query parameters to the page as well, eg.:CSP>>> GET /csp/samples/request.csp?A=1&B=2
The output you see is what would be sent to the browser, including any HTTP headers. You can also interact with the session, request and response objects via the special variables %session, %request and %response.
CSP:SAMPLES>>> get /csp/samples/menu.csp
This drops us into the regular command line debugger.
I hope this helps. -Fab
- Log in to post comments