Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 336
  • Last Modified:

Help with Servlet

If I needed to pass an additional parameter on this, how would I go about doing it:

public void doAction( Context ctx, BcSQLAgent agt, HttpServletRequest req, HttpServletResponse response) throws ServletException, IOException, Exception
  {
    SimpleDateFormat dateFormatLong = new SimpleDateFormat("MMMM dd, yyyy");

    String caseId = req.getParameter ("caseId");
    String homeId = req.getParameter ("homeId");
    String fileName = req.getParameter ("documentFileName");
    String dmDocumentId = req.getParameter ("dmDocumentId");
    String fileExt = fileName.substring( fileName.lastIndexOf(".") );
    String savedFileName = new String();
    String savedFileNameOriginal = new String();
    String savedFileNameNoSpaces = new String();
    String savedFileNameNoSpacesOriginal = new String();
    String templateFile = "fhfiles/templates/" + fileName;
    String tempString = new String();
    String generalDocumentType = req.getParameter ("generalDocumentType");

    WordTemplate oWW = null;

    String serverName = req.getServerName();
    Home h = ctx.getHome( agt );
    BcInteger _homeid = new BcInteger(ctx.getHomeId());

    Case c = new Case (agt);
    Package pack = new Package( agt );
    Properties _tagsByName = new Properties();
    TagHandler _tagHandler = new TagHandler( ctx, agt );

Thanks, Midani Tickabooma
0
Midani22
Asked:
Midani22
  • 4
  • 4
1 Solution
 
for_yanCommented:
what kind of additional parameter do you need?
Thsi method (usually actully those are rather methods doGet()  or doPost())
is called by container, so you cannot modify the parameter list
I think you in theory  can have a setXXX() method in servlet, but why would you need it - you normally don't need it.
Explauin what it is you want to accomplish
0
 
for_yanCommented:
All parameters are normally coming from the form which user fills in and are passed through the Request object as you see in your own code
0
 
Midani22Author Commented:
The servlet controls the action for instance:

https://209.173.134.79:7001/DMTemplateLoaderFLReports?sdate=03/16/2010&edate=03/19/2012&caseid=0&homeid=1&parentid=1&userid=100059&mode=APA&documentFileName=1-EmbalmingReport.doc&homeId=<xsl:value-of select="../../Home/Id"/>&amp;transId=NA&amp;dmDocumentId=<xsl:value-of select="../../DMDocumentId"/>


and this is the code. I need to make sure that the parentid parameter is getting passed. See attached script.
DMTemplateLoaderFLReports.txt
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
for_yanCommented:
you just add

String dmparentid= req.getParameter ("parentid");

the same way you do it with caseid and homeid
0
 
Midani22Author Commented:
That's all?

Just double-checking everything.
0
 
for_yanCommented:
>That's all?
if you are passing this way caseid and homeid why not to pass the same way parentid?
Thsi is normal way how parameters get into the servlet

I would rather normally use doGet() method in such aceses but idf it works this way then fine



>Just double-checking everything.  
what that means?
0
 
Midani22Author Commented:
means just trying to get cha to confirm your answer. Thanks a lot! :)
0
 
Midani22Author Commented:
english language concern
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now