Questions tagged [forward]

There are myriad kinds of forwarding. Use this if you must, but try to find a more specific [tag] first.

There are many kinds of forwarding. As such, this tag is generally to general.

Try to use a more specific one, like , , , , and many more.

664 questions
127
votes
9 answers

RequestDispatcher.forward() vs HttpServletResponse.sendRedirect()

What is the conceptual difference between forward() and sendRedirect()?
RKCY
  • 3,757
  • 11
  • 53
  • 93
103
votes
8 answers

java.lang.IllegalStateException: Cannot (forward | sendRedirect | create session) after response has been committed

This method throws java.lang.IllegalStateException: Cannot forward after response has been committed and I am unable to spot the problem. Any help? int noOfRows = Integer.parseInt(request.getParameter("noOfRows")); String chkboxVal = ""; …
74
votes
7 answers

Difference between JSP forward and redirect

Please explain the difference between jsp:forward and redirect. What is happening in each case?
Ammu
  • 4,607
  • 9
  • 31
  • 34
69
votes
3 answers

Usage of std::forward vs std::move

I always read that std::forward is only for use with template parameters. However, I was asking myself why. See the following example: void ImageView::setImage(const Image& image){ _image = image; } void ImageView::setImage(Image&& image){ …
bweber
  • 2,976
  • 2
  • 20
  • 49
54
votes
4 answers

Why do two programs have forward referencing errors while the third does not?

The following does not compile, giving an 'illegal forward reference' message: class StaticInitialisation { static { System.out.println("Test string is: " + testString); } private static String testString; public…
danger mouse
  • 1,397
  • 1
  • 14
  • 28
52
votes
5 answers

What is the difference between response.sendRedirect() and request.getRequestDispatcher().forward(request,response)

I have got a problem with my page jump when I use JAVA, if I use: response.sendRedirect("login.jsp") then I get this url: http://localhost:8080/login.jsp But if I use request.getRequestDispathcer("login.jsp").forward(request, response) then I get…
roger
  • 6,477
  • 13
  • 55
  • 102
50
votes
3 answers

C Programming: Forward variable argument list

I'm trying to write a function that accepts a variable number of parameters like printf, does some stuff, then passes the variable list to printf. I'm not sure how to do this, because it seems like it would have to push them onto the stack.…
Joshua Cheek
  • 26,664
  • 15
  • 67
  • 81
49
votes
4 answers

Difference between include and forward mechanism for request dispatching concept?

Forward() : This can be done in two ways by Request & ServeletContext. Forwarding a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server. Forward is done at server side, without the client's knowledge. When…
Ajay Takur
  • 5,287
  • 4
  • 31
  • 50
33
votes
1 answer

What is the difference between redirect and navigation/forward and when to use what?

What is difference between a navigation in JSF FacesContext context = FacesContext.getCurrentInstance(); context.getApplication().getNavigationHandler().handleNavigation(context, null, url); and a redirect HttpServletResponse response =…
ad-inf
  • 1,471
  • 4
  • 29
  • 50
27
votes
4 answers

Spring forward with added parameters?

Is there a way to forward a request to another Controller while adding some parameter data to it? I tried adding to the ModelMap, but it doesn't seem to hang around. I am doing something like: return "forward:/my-other-controller"; Only other way I…
Tony R
  • 10,116
  • 21
  • 70
  • 100
27
votes
4 answers

How to access site through IP address when website is on a shared host?

I want to edit my host file to forward a website to another IP, but that IP is on a shared host, so the IP doesn't take me to the domain I want. Is there a way around this? i.e. Website: http://somerandomservice.com/ Ping the site and go to:…
Andrew Tsay
  • 1,543
  • 6
  • 18
  • 31
23
votes
3 answers

Predicting a multiple forward time step of a time series using LSTM

I want to predict certain values that are weekly predictable (low SNR). I need to predict the whole time series of a year formed by the weeks of the year (52 values - Figure 1) My first idea was to develop a many-to-many LSTM model (Figure 2) using…
Lucas Brito
  • 1,026
  • 1
  • 17
  • 34
22
votes
4 answers

What's the difference between RequestDispatcher.forward() and HttpServletResponse.sendRedirect()?

What is the difference between RequestDispatcher's forward() and HttpServletResponse's sendRedirect() method? Can anyone explain with a example and best usage of these methods with a real time example?
Raj
  • 2,161
  • 10
  • 31
  • 51
20
votes
4 answers

undefined C struct forward declaration

I have a header file port.h, port.c, and my main.c I get the following error: 'ports' uses undefined struct 'port_t' I thought as I have declared the struct in my .h file and having the actual structure in the .c file was ok. I need to have the…
ant2009
  • 30,351
  • 141
  • 365
  • 559
16
votes
1 answer

Apache forwarding request to another server

I want apache to forward request coming to one server to another server. Here is the complete scnario: There are 3 servers: Machine A - IP: A.A.A.A - Client machine which wants to call an API there on machine C. Machine B - IP: B.B.B.B -…
user1270392
  • 2,401
  • 4
  • 19
  • 24
1
2 3
44 45