Neha Thakur
Neha Thakur

Reputation: 1

calling servlet from action class

I am calling a servlet from an action class by using forward. It is then going to the servlet but it is not showing the output.

Actually I have create a PDF file which I need to show it on runtime. If I run that servlet only on server then it is showing the PDF file I want to. But if I forward it from the action class it is not not showing anything. I have given a simple condiiton on the action class like this:

 if(id.equals("SGSY"))
    {
    forward = mapping.findForward("SGSY");
    }
    else
    {
    forward = mapping.findForward("fail");
    }

After this it is going to servlet but not actually showing the output. I don't understand why. Am I doing something wrong?

Upvotes: 0

Views: 2001

Answers (1)

vivekj011
vivekj011

Reputation: 1149

Try response.sendRedirect 1st instead of forward mapping,if it works it means there must be problem with your path

Upvotes: 1

Related Questions