Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How to direct struts action forwards to a new window where a PDF will display?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have the following class that handles the TAB navigation called "bol", I want the navigation to forward to a new window upon clicking the Print Button, I have the Print routine coded up but the Navigation is the big ISSUE here. How can i navigate to a new window where the PDF will be displayed?
This class displays the TAB driven mechanism but the button click will not navigate to a new session(screen) for me. Any ideas are appreciated.
thanks,
Srini
=============================================================
public class MaintBolDetailAction extends FAKTabBaseAction {

public ActionForward doInit(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {

HttpSession session = request.getSession();
String currentAction = null; // 10/22/2012 2545 dbh

//Get the shipment details for the BOL tab
String shipmentId = null;
shipmentId = session.getAttribute("FAK_SHIPMENT_ID").toString();
SiFakShipmentMaintBolTabForm bolDetailForm = (SiFakShipmentMaintBolTabForm) session.getAttribute("SHIPMENT_BOL_DETAIL");
// if (bolDetailForm == null) { 10/24/2012 2545 dbh - Always get fresh data
bolDetailForm = new SiFakShipmentMaintBolTabForm();
bolDetailForm.setShipmentId(shipmentId);
try {
bolDetailForm.getFormHandler().initialize(bolDetailForm, request);
session.setAttribute("SHIPMENT_BOL_DETAIL", bolDetailForm);
} catch (Exception e) {
}
// }

// 10/22/2012 2545 dbh start
currentAction = (String) session.getAttribute("FAK_CURRENT_ACTION");
if (currentAction != null && currentAction.equals("bol")) {
session.setAttribute("FAK_CURRENT_ACTION", null);
}
// 10/22/2012 2545 dbh end
session.setAttribute("FAK_CURRENT_TAB", "bol");
return mapping.findForward("home");
}
=====================================================================
<action path="/showBolPDF"
type="pdf.ShowBolPdfAction" />
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think you can open a new window from the server. That's something the browser does.
 
srinivas sosale
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Joe,
You're right when you say the browser does open the new window and not the server. Traditionally our code used to follow the struts framework and set the next page to "home", but the "Tab Driven" methodology is not performing the struts functionality, Do you have any ideas on how to force a new window just for the PDF? Hope i'm clear on this.
thanks for your response.
Srini
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

srinivas sosale wrote:the "Tab Driven" methodology is not performing the struts functionality,



I'm not sure what you mean by "methodology". Are you not using Struts? If you want to open a new window, you'd do it with whatever link displays the PDF.
 
All that thinking. Doesn't it hurt? What do you think about this tiny ad?
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic