Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6663609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:31:05+00:00 2026-05-26T02:31:05+00:00

why do i get exception on (redirect/get) in this program #lang web-server (require web-server/formlets

  • 0

why do i get exception on (redirect/get) in this program

#lang web-server
(require web-server/formlets web-server/page) (struct app (nm) #:mutable)
(define (start req) (render-main-page req))

this function is to be used by most pages and generates comlete page xexpr by calling each given piece of page generator functions, each of which may embed their urls

(define (render-page embed/url a-title blocks)
     (response/xexpr `(html (head (title ,a-title) 
         (body ,@(map (lambda (block) (block embed/url)) blocks))))))

this is piece of first page generator function

(define (render-action-panel embed/url action)
  `(a ([href ,(embed/url action)]) "New"))

this is first page

(define/page (render-main-page)
  (local [(define (new-handler req) (render-app-page req (app "new value")))
          (define (panel-block embed/url) (render-action-panel embed/url new-handler))]            
    (render-page embed/url "Title" (list panel-block))))  

this is piece of second page generator function (represents form)

(define (add-app-formlet an-app) (formlet (#%# ,{=> input-string nm}) nm))
(define (render-app-form embed/url an-app save-handler)
  `(div (form ([action ,(embed/url save-handler)][method "POST"])
              (span ,@(formlet-display (add-app-formlet an-app) ))
              (span (input ([type "submit"][value "Save"]))))));)

the second form,
save handler throws exception when trying do post-redirect-get

(define/page (render-app-page an-app)
  (local [(define (save-handler req)
            (render-app-page 
             (redirect/get) 
             (set-app-nm! an-app (formlet-process (add-app-formlet an-app) req))))
          (define (form-block embed/url)
            (render-app-form embed/url an-app save-handler ))
          ]
    (render-page embed/url "Title - form: " (list form-block))))

(require web-server/servlet-env)
(serve/servlet start)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:31:05+00:00Added an answer on May 26, 2026 at 2:31 am

    Which redirect/get are you using?

    The one from web-server/lang/servlet (which should be used with #lang web-server) is different than the one from web-server/servlet (which should be used with #lang racket (and friends))

    This error message means that you are using the one from web-server/servlet.

    FWIW, web-server/page cannot be used with #lang web-server because it is just a simple macro over the send/suspend/dispatch from web-server/servlet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this exception on my Windows 7 64bit in application running in VS
why do i get this exception? Map myHash = null myHash = (HashMap)Collections.synchronizedMap(new HashMap());
When I debug a C# program and I get an exception throwed (either thrown
In my current program, i'm accessing a HTTP Basic authenticated page like this, which
I have Struts 2 configured to redirect any java.lang.Exception to a special Action which
I've got a Polish version of Windows installed and therefore I get exception messages
I get security exception when using System.Net.WebClient to do HTTP requests, which is due
I get an exception thrown at runtime when I set AllowsTransparency=True I get an
When I get an exception in code called by Silverlight whilst in debug mode
When using Marshal.GetExceptionCode() how do you get the Exception Type and/or instance of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.