How to avoid present 302 page
Hi,
In my app, I use jsp with servlet, and the servlet acts as the "traffic cop",
that is, the users fill up the form in jsp pages, and the jsp pages are submitted
(post) to this servlet, this servlet do some work and get the next jsp page to
present, and use response.sendRedirect(page). The problem is the "sendRedirect"
method, some user complain that they submit the form and got a page says "The
document you reqested has moved temporarily" and there is a link, after the user
clisk the link, it got the right page.
I checked the log file, the form post returns 302 code, and the next page (redirected
by sendRedirect method) is invoked as GET and returns 200.
I thought about the forward, but the images in the jsp all has relative path,
so the call will be /myservelt/images/...gif. That doesn't work.
what can I do to avoid the problem and send the page directly?
Thanks
Thanks. I still can't have a good idea how to deal with. By reading it I may set
the status code to 303 and get the post to be auto redirected, but this is the
http1.1 new feature, I don't know what's the percentage of browsers support http1.1.
I am assuming the older version browsers is for http1.0
"Deepak Vohra" <[email protected]> wrote:
>
>For status codes refer to
>http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/Servlet-Tutorial-Response-Status-Line.html
>
>
>"John" <[email protected]> wrote:
>>
>>Hi,
>>
>>In my app, I use jsp with servlet, and the servlet acts as the "traffic
>>cop",
>>that is, the users fill up the form in jsp pages, and the jsp pages
>are
>>submitted
>>(post) to this servlet, this servlet do some work and get the next jsp
>>page to
>>present, and use response.sendRedirect(page). The problem is the "sendRedirect"
>>method, some user complain that they submit the form and got a page
>says
>>"The
>>document you reqested has moved temporarily" and there is a link, after
>>the user
>>clisk the link, it got the right page.
>>
>>I checked the log file, the form post returns 302 code, and the next
>>page (redirected
>>by sendRedirect method) is invoked as GET and returns 200.
>>
>>I thought about the forward, but the images in the jsp all has relative
>>path,
>>so the call will be /myservelt/images/...gif. That doesn't work.
>>
>>what can I do to avoid the problem and send the page directly?
>>
>>Thanks
>
Similar Messages
-
How to avoid submitting a page when tabular form rows are empty
Hi,
I have a master detail form in my application. There are 2 tables that are used Table A and Table B. Table A contains Ticket number and Table B refers to Table A through a foriegn key and Table B have columns like Date,Name, Age, ticket_id (that refers to the ticket_number of the Table A).
This is how the application works:
In a page there is a field for Ticket Number, once the user enters the Ticket Number and click Add Details, a tabular Form with 5 empty field appears... (Done through Page Process->Data Manipilation->Add Rows)
This form contains fields Date, Name and Age. Once the user fills in all the details and click Submit button, the page is submitted. Whatever values that was entered is saved in Table B. Page Sucess message appears. This works fine.
But once the Ticket Number is entered and Add Details is clicked, and without entering the values in the Tabular Form, if Submit button is clicked, there is no error showing up neither I see Page success message. But this should not be allowed. There should be some error showing up...
Tabular Form Validations works only when user enters some values in the Tabular Form and click Submit. For the above scenario, where the form is untouched the validation doesnt work.
How can I get this done? Any ideas?Hello Suzi,
>> if (document.wwv_flow==null)
The document.wwv_flow is an object representing the current form that was just rendered on your screen. As such, it can never be null.
>> How to avoid submitting a page when tabular form rows are empty
The correct way, especially for versions prior to APEX 4.0 is to use JavaScript, but for that, you need to know and understand how APEX generates your tabular form, HTML wise.
To be very brief, APEX attached a unique ID to every updatable cell in the tabular form, using a certain pattern – each updatable column is getting a unique name (e.g. ‘f01’,’f02’ etc.) and the ID of a cell is a combination of this name with the serial row number the cell is on. For example, a cell on the third row in an updatable column called ‘f04’ will be given an ID of f04_0003. (More detailed explanation, with an example, can be found in my book).
What you should do is to check these cells according to your validation policy (e.g. is all five row must be filled, is all the columns in a specific row must be filled, etc.).
Regards,
Arie.
♦ Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
♦ Author of Oracle Application Express 3.2 – The Essentials and More -
How to avoid Moved Temporarily page
Hi,
In my app, I use jsp with servelet, and the servelet acts as the "traffic cop", that is, the users fill up the form in jsp pages, and the jsp pages are submitted (post) to this servelet, this servlet do some work by calling other helper class and get the next jsp page to present, and use response.sendRedirect(page). The problem is the "sendRedirect" method, some user complain that they submit the form and got a page says "The document you reqested has moved temporarily" and there is a link, after the user clisk the link, it got the right page, and do another submit for next step, the same thing happed aggain.
I checked the log file, the form post returns 302 code, and the next page (redirected by sendRedirect method) is invoked as GET and returns 200.
what can I do to avoid the problem some user has by presenting the page directly?
ThanksIf you use "forward" instead of "redirect" that won't happen. It might even be a better design, since redirecting displays a URL in the browser's address bar that the client can use to go directly to the JSP instead of through your traffic cop.
-
How to avoid printing a page if does not contain data in smart forms
deat all,
here is urgent requirement for me .
i have 3 pagelayouts in smartforms.
if there is no data in page 2 how to avoid it from printing(the second page should not come in even if it contains hedings and logo)try like this
if@section:IND=1
this template
end ifsectionbreak
if@section:IND=2
this template
end if -
How to avoid starting a page with line breaks?
Hello. I've just started to refine my Master's thesis and some of the topics moved up and down as I edited their contents. The problem is that in some cases the topic breaks right after the title, and the rest of the contents just move away to another page. Is there any way to avoid starting a page with line breaks or broken topics?
At the end of your title, you didn't inserted a line break but a paragraph break (carriage return).
Acivate the mode "Show hidden characters"
Select the carriage return (paragraph break)
Delete it
Press Shift + return to insert a true line break.
It may be useful to apply that several times if you inserted several carriage returns between the title and the first filled line.
Yvan KOENIG (VALLAURIS, France) 15 mai 2011 19:40:14 -
How to avoid @PostConstruct on page Faces beans during postback?
Hello, we're using GlassFishV2/JSAS9.1 with Mojarra 1.2_04-b22-p05 for a large project, and experiencing performance issues on form-less JSF commands when used in conjonction with @PostConstruct annotations. I feel this is an architectural issue I'm not able to resolve though, so I was wondering if anyone could shed some light on whether I'm missing something, there is some known workaround or it's a known JSF problem?
The scenario is as follows:
* Page my.jsp references Faces Beans MyFB.java
* MyFB has @PostContruct method, which execute expensive logic to initialize the data model before rendering phase
* my.jsp has a <commandLink action="#{anotherFB.myCommand}">
* anotherFB.myCommand executes some logic and nav to another.jsp
Now what seems to happen is that when we click on the commandLink, JSF does a postback to the same URL, instantiates MyFB, calls @PostConstruct on MyFB, and then instantiate anotherFB to call myCommand on it and nav to another.jsp
In this situation, the expensive @PostConstruct logic to prepare data for rendering on my.jsp is executed although it is totally useless to the use case and hurts site performance a lot.
I tried to use immediate="true" attribute, but it doesn't seem to prevent the @PostConstruct...
In the case of a JSF form commandButton on the same bean, I can see how that would be necessary, but for a commandLink to another bean, why is JSF calling @PostConstruct on the previous page beans??
I seem to be able to workaround this problem doing an if (getFacesContext().getRenderKit().getResponseStateManager().isPostback(getFacesContext()) in our @PostConstruct method and then make sure all the getters are NPE-safe, but if the commandLink is in a common include file, I'd then have to do this in every single beans within my app, which is not reasonable IMHO.
Has anyone else experienced this problem? Or even maybe worked around it somehow?
I'm curious if I'm missing something or if this is a major JSF architectural issue...
Thanks!Thanks for the suggestion.
We used to do this in the past, but this yields a host of other issues including:
* no control over when getters get called and in what order
* getters can get called multiple times, so you have to implement some caching to avoid init re-execution and it can get complicated in large object models
* if a getter implements logic and blows up in the rendering phase, part of the page may have already been flushed out and you can't recover with an error page
etc.
@PostConstruct is a great standard-based option to get a bean initialized early in the JSF lifecycle, but there's just this one issue with commandLink that's problematic... :(
We're sometimes using Shale's prerender callback, which is not invoked on a postback, but I was hoping there was maybe a standard-based solution? -
How to avoid a blank page at end of the page?
Hi Experts,
I have created a smartform where i need to display the line items based on the customer data.
I have created a command at the end of the loop. For every new customer it has to go to new page. After the completion of the report i'm getting a blank page at the end.
If i take a single customer or multiple customer, I'm getting a blank page at the end. I need to avoid this.
Please let me know the procedure to avoid it.
Thanks and Regards,
Abdur RafiqueHi,
Try this logic
In the "Initialization" tab of global definitions
DESCRIBE TABLE IT_TAB LINES W_COUNT.
Here IT_TAB contains all the customers
While looping IT_TAB count the records into W_COUNT_CURRENT " Current record count
In the COMMAND give the condition
W_COUNT_CURRENT <> W_COUNT (Go to new page as long as current customer is not the last customer)
For the last customer both variable will be equal and there will not be a new page.
Note that the COMMAND must be at the end of the LOOP for this logic to work
Regards -
Dear All,
How to aviod the test print page in printing. I am getting SAP cover page(test print page) for every time I am printing. I ma using the following code.
CASE sy-ucomm.
WHEN 'PRNT'.
DATA: l_params TYPE pri_params,
l_valid TYPE c,
l_arc_params TYPE arc_params.
l_params-prsap = 'X'.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
destination = 'LPIN'
copies = 1
list_name = 'TEST'
list_text = 'Test NEW-PAGE PRINT ON'
immediately = 'X'
layout = 'X_65_132'
line_count = 65
line_size = 220
release = 'X'
mode = 'CURRENT'
no_dialog = 'X'
IMPORTING
out_parameters = l_params
valid = l_valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
NEW-PAGE PRINT ON PARAMETERS l_params NO DIALOG.
PERFORM display_data.
NEW-PAGE PRINT OFF.
ENDCASE.
Thanks,
RanjanHi,
Just check it out. I m printed report directly instead of display.
w_destination = 'LOCL'.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
destination = w_destination
layout = 'X_58_170'
no_dialog = 'X'
IMPORTING
out_parameters = params
valid = valid.
IF valid <> space.
ALL DISPLAY PARAMETER RIGHT ON PRINTER
NEW-PAGE PRINT ON PARAMETERS params NO DIALOG.
ELSE.
GIVE ERROR PRINTER DESTINATION IS NOT VALID
MESSAGE s208(00) WITH text-010.
ENDIF.
ENDIF.
User write stament, That will dirctly go for print.
OFF THE PRINTING AFTER REPORT IS DISPLAY
IF valid <> space.
NEW-PAGE PRINT OFF.
ENDIF.
it may sortout ur problem.
Regard,
Vinod -
How to avoid that every page of a smartform is going to be printed out
Hi,
I have following problem. In my smartform I builded different pages (like a cover page, different lists etc.). The user should decide by setting parameters what lists he want to print. So if he don´t need the cover page, it should not be printed out.
Is there any way to set this up in the smartform? Right now, the printing parameters (what the user wants to print) are stored in an internal table and should be processed in the smartform. My problem is that there is no way to implement conditions on a page in a smartform.
Please let me know if somebody has a solution for this requirement.
Thanks a lot,
John Caspar
<MOVED TO CORRECT FORUM BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Apr 15, 2009 8:49 AMHi Micky,
The external debugging works. Thank you very much!
And how can I reward you? -
How to avoid blank page in the report?
adding a field in the grouping and checking the page break option means then we are getting blank page as the first page of the report? How to avoid this blank page?
Usually blank pages appear as first page due to the presence of filler lines (//////) on top of report header.Please ensure that the top header is exactely started from top of page itself.
-
How to avoid a line of data being cut by page jump ?
Dear Java Experts,
I have encountered a very troublesom problem!
The problem is described as follows:
When the browser (IE or Netscape) contains many HTML character data (especially HTML tables and data from DATABASE), how can I print the data to client's printer
(i.e. browser's printer) without having a line of data cut by page jump?
That is how to avoid a line of data cut by page jump, upper part of the data in one page and lower part in next!
I think the problem should be solved with client's java applet!
Can any expert give me sample code to solve the problem or indicate me where I can find documents about solving the problem?
Thank you very much in advance!!
Best Regards,
Jackie SuHTML is not really meant for device-specific presentation (despite a lot of abuses in this area).
I don't think you're going to solve this satisfactorily with HTML, no matter what you jury-rig around it.
If this kind of presentation control is a requirement, you're probably better off with a format that directly supports this--PDF is the most obvious choice.
There's a sourceforge project that supports PDF generation from Java (http://sourceforge.net/projects/itext/ - I don't have any experience with it) and I think there may be others.
And I believe there are also commercial products for this. -
How to avoid printing a blank page when there is 'no data' in the report.
how to avoid printing a blank page when there is 'no data' in the report.
try like this
if@section:IND=1
this template
end ifsectionbreak
if@section:IND=2
this template
end if -
Cheque printing. How to avoid last page in case of check printing in F110?
F-68 prints only one page whereas F110 prints 2 pages.
How to avoid last page in case of check printing using F110? Is there any other option than changing the Script.Hi,
Im also facing the same issue. Generates 1 page with F-58 but 2 pages with f110. Kindly let me know how to resolve. -
How to avoid the page to move up when I click the button on the Tableview?
Hi, EP fellows.
I currently have 3 tableViews and 1 header form set in one jsp page (I know, it may not be a good design to put three tableView in one jsp page.....but for the sake of avoiding client side eventing between each tableViews..I combined them into one jsp page). I set the Load/Navigation value to be URL.
Here is the problem. Everytimes I click on the Navigation button (Up/Down) to navigate the tableView data to another page, the whole page will move up and away from the table that I navigating.
I know it is bacause the page get refreshed, and go to the first item of the page. In this case, how do I avaoid the page to move up and away form the tableView? As it is really look bad when user click on the button, they have to scroll back to the tableView they click.
Thanks for advices.
KentAs far as i remember,this javascript function pops user a dialog to save a file:
javascript: document.execCommand('SaveAs','1',null);
But i m not sure will it pop up for pdf, just try to google javascript to save a pdf file.
--Mukul -
How to avoid printing a balnk page at the end in the Adobe form output
Hello Experts,
Can anyone please let me know as how to avoid/delete the blank page at the end of adobe form output.
I have a master page with header n footer and a body page seperate.
For ex.. I have 3 line items and i want each line item to be displayed in the new page. I am able to get this functionality . I have set the settings in the paginationb tab of the subform as
"after " Go to Next content Area" " but an extra page is getting printed at the end. 3 + 1 extra pages total. I want to avoid this blank page. I have checked the Allow page break with in content box but it is still not working.
Can someone guide me as how to solve this problem.
Any help is appreciated. Thanks in advance.
Regards,
Maheshhey mahesh,
this normally happens because of triggering a new page manually, what u would have done is that you would be checking for the new line item and when this condition is satisfied , you are triggering a new page , the reason for the last blank page is that the condition gets satisfied ( beacuse the line item number changes from the last line item no to initial or space).
This can be handled by doing the following
By knowing the number of line items by the following stmt.
describe table itab lines v_lines.
Now you have the value in v_lines.
use a counter in ur form and keep it increasing it by 1 ( say v_sno ) ie v_sno = v_sno + 1 in the loop of ur internal table.
ONLY WHEN V_LINES IS LESS THAN OR EQUAL TO V_SNO , TRIGGER THE NEW PAGE
this should be along with the condition which u have already put, ie when ever line item no changes
when both these conditions are satisfied , then only the new page will be triggered.
Hope it helps,
Reward if useful,
Regards,
KP.
Maybe you are looking for
-
Why is Call Block not available?????
I've started getting these harrasing political phone calls from the same number. In the past, I remember that I could use Call Block (*60) to block them. I now see that the feature is "no longer available to new customers". So how do I keep these cr
-
Can I combime HTMLB and CSS? (i.e., I want to make sure that all the buttons across multiple pages have the same color etc.) It seems that combining HTMLB and CSS is not recommended because there hardly any documentation on this. So, is there a recom
-
Crashing Repeatedly OS X 10.9.3
My 2013 Macbook Air is crashing. OS X 10.9.4. It all started after I changed my user/administrator password before leaving town. And forgot the new one. I reset my password using my Apple ID, which seemingly led to a few problems: 1. Keychain issues:
-
Introducin​g the lamination layer to protect your diagram from damage!
It's sort of half serious... But, as an extension to what I think is a (very) clever use of the Sequence Structure as diagram carpet aiming at hiding all those distracting pass-through wires, I am proud to introduce the transparent label as a "lamin
-
Well , my ipod fell alot when its with me. Like now it has a broken screen & before the broken screen its been in water. So the thing is , my ipod wont charge! Like everytime i put it in a charger the screen shows a picture of a battery with a red b