Skip to Content
0
Jan 09, 2013 at 10:12 AM

Captcha imge implimentation in EP 7.0

79 Views

Hi expets,

I have a scenario like to impliment Captcha in one of my component in sap ep 7.0 and i tried with below links but i couldnt get capthca image in jsp.

i refered below links.

http://zetcode.com/tutorials/jeetutorials/captcha/

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/549817c4-0401-0010-04b4-de2e1b56493b?QuickLink=index&overridelayout=true&5003637098237

in JSP image tag i replaced with below one

<img src="http://hostname:port/irj/servlet/prt/portal/prtroot/Captcha_test.captchHandler" >

in Java class insted of direct httpservletrespone getting from IPortalComponentResponse

IPortalComponentResponse componentResponse = (IPortalComponentResponse) this.getResponse();

HttpServletRequest req=null;

HttpSession session =null;

HttpServletResponse httpresponse=(HttpServletResponse)response.getRequest().getServletResponse(true);

httpresponse.setContentType("image/png");

OutputStream os = httpresponse.getOutputStream();

please help me to resolve the issue..

Thanks in Advace,

Prasad.