home configuration implementation extending download about

 

Xserver

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Configuration is done through web.xml. All values can be left blank and a default implementation will be shown

The captcha servlet will put a key in the user session (with each request the value will be overridden) that can be picked up from any controller:

(String)session.getAttribute(nl.captcha.servlet.Constants.SIMPLE_CAPCHA_SESSION_KEY)

This is almost against my religion but we must stay pragmatic....

 

Some configuration options in web.xml. But please checkout the most recent version in web.xml of the war that is downloadable form sourceforge. I'm currently changing stuff faster than the documentaion seems to be able to handle.....

<!--border around captcha. Legal values are yes or no. Defaults to yes Other values will be ignored-->

<init-param>
<
param-name>cap.border</param-name>
<
param-value>yes</param-value>
</
init-param>

<!--color of the border. Legal values are r,g,b(and optional alpaha) or white,black,etc. Other values will be ignored-->
<
init-param>
<
param-name>cap.border.c</param-name>
<
param-value>black</param-value>
</
init-param>

<!--thickness of the border around captcha. Legal values are > 0 other values will be ignored. Defaults to one-->
<
init-param>
<
param-name>cap.border.th</param-name>
<
param-value>1</param-value>
</
init-param>

<!-- the image producer. Currently only one-->
<
init-param>
<
param-name>cap.cap.producer</param-name>
<
param-value>nl.captcha.obscurity.imp.DefaultCaptchaIml</param-value>
</
init-param>

<!-- the text producer. defaults to a random character thing. But there is a first name generator aswell-->
<
init-param>
<
param-name>cap.text.producer</param-name>
<
param-value>Default</param-value>
<!--
<param-value>nl.captcha.text.FiveLetterFirstNameTextCreator</param-value>-->
</
init-param>

<!-- incase the default generator is chosen. The characters that will create the string can be configured aswell please-->
<!--
notice that if japanese or chinese characters are chosen the fonts chosen below will have to support these-->
<
init-param>
<
param-name>cap.char.arr</param-name>
<
param-value>2,3,4,6,7,8,a,b,c,d,e,f,g,h,k,o,r,s,t,x,y</param-value>
</
init-param>

<!--if default captcha producer is slelected this value represents the amount of chars that are supplied in the captcha. values below 2 are not exepted when omitted defaults to 5-->
<
init-param>
<
param-name>cap.char.arr.l</param-name>
<
param-value>7</param-value>
</
init-param>

<!-optional font array for the captcha-->
<
init-param>
<
param-name>cap.font.arr</param-name>
<
param-value>Arial,Helvetica,Courier,TimesRoman</param-value>
</
init-param>

<!-- image size-->
<
init-param>
<
param-name>cap.font.size</param-name>
<
param-value>40</param-value>
</
init-param>

<!-- font color. values can be either red,yellow,blue,cya etc or r,g,b (optional alpha value)-->
<
init-param>
<
param-name>cap.font.color</param-name>
<
param-value>166,31,255</param-value>
</
init-param>

<init-param>
<
param-name>cap.distortionImp</param-name>
<
param-value/>
</
init-param>

<init-param>
<
param-name>cap.backgroundImp</param-name>
<
param-value/>
</
init-param>

<!--values can be either red,yellow,blue,cya etc or r,g,b,alpha value-->
<
init-param>
<
param-name>cap.background.c.to</param-name>
<
param-value>255,255,255</param-value>
</
init-param

<!--values can be either red,yellow,blue,cya etc or r,g,b,alpha value-->
<
init-param>
<
param-name>cap.background.c.from</param-name>
<
param-value>75,75,255</param-value>
</
init-param>

<!- not implemented yet-->
<
init-param>
<
param-name>cap.noiseImp</param-name>
<
param-value/>
</
init-param>

 

 

SourceForge Logo