archive-cr.com » CR » L » LLOBET.CO.CR

Total: 247

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Apache Tomcat 8 (8.0.24) - Advanced IO and Tomcat
    processed the request and response objects as well as all their dependent objects will be recycled and used to process other requests End will also be called when data is available and the end of file is reached on the request input this usually indicates the client has pipelined a request EventType ERROR Error will be called by the container in the case where an IO exception or a similar unrecoverable error occurs on the connection Fields that have been initialized in the begin method should be reset After this event has been processed the request and response objects as well as all their dependent objects will be recycled and used to process other requests There are some event subtypes which allow finer processing of events note some of these events require usage of the org apache catalina valves CometConnectionManagerValve valve EventSubType TIMEOUT The connection timed out sub type of ERROR note that this ERROR type is not fatal and the connection will not be closed unless the servlet uses the close method of the event EventSubType CLIENT DISCONNECT The client connection was closed sub type of ERROR EventSubType IOEXCEPTION An IO exception occurred such as invalid content for example an invalid chunk block sub type of ERROR EventSubType WEBAPP RELOAD The web application is being reloaded sub type of END EventSubType SESSION END The servlet ended the session sub type of END As described above the typical lifecycle of a Comet request will consist in a series of events such as BEGIN READ READ READ ERROR TIMEOUT At any time the servlet may end processing of the request by using the close method of the event object CometFilter Similar to regular filters a filter chain is invoked when comet events are processed These filters should implement the CometFilter interface which works in the same way as the regular Filter interface and should be declared and mapped in the deployment descriptor in the same way as a regular filter The filter chain when processing an event will only include filters which match all the usual mapping rules and also implement the CometFiler interface Example code The following pseudo code servlet implements asynchronous chat functionality using the API described above public class ChatServlet extends HttpServlet implements CometProcessor protected ArrayList HttpServletResponse connections new ArrayList HttpServletResponse protected MessageSender messageSender null public void init throws ServletException messageSender new MessageSender Thread messageSenderThread new Thread messageSender MessageSender getServletContext getContextPath messageSenderThread setDaemon true messageSenderThread start public void destroy connections clear messageSender stop messageSender null Process the given Comet event param event The Comet event that will be processed throws IOException throws ServletException public void event CometEvent event throws IOException ServletException HttpServletRequest request event getHttpServletRequest HttpServletResponse response event getHttpServletResponse if event getEventType CometEvent EventType BEGIN log Begin for session request getSession true getId PrintWriter writer response getWriter writer println DOCTYPE html writer println head title JSP Chat title head body writer flush synchronized connections connections add response else if event getEventType CometEvent EventType ERROR log Error for session

    Original URL path: http://www.llobet.co.cr/docs/aio.html (2015-10-31)
    Open archived version from archive


  • Apache Tomcat 8 (8.0.24) - Additional Components
    list Full commons logging implementation Web Services support JSR 109 JMX Remote Lifecycle Listener Introduction A number of additional components may be used with Apache Tomcat These components may be built by users should they need them or they can be downloaded from one of the mirrors Downloading To download the extras components open the Tomcat download page and select Browse from the Quick Navigation Links The extras components can be found in bin extras Building The additional components are built using the extras target of the standard Tomcat Ant script which is present in the source bundle of Tomcat The build process is the following Follow the build instructions to build a Tomcat binary from the source bundle note it will be used by the build process of the additional components but does not need to be actually used later on Execute the command ant extras to run the build script The additional components JARs will be placed in the output extras folder Refer to the documentation below about the usage of these JARs Components list Full commons logging implementation Tomcat uses a package renamed commons logging API implementation which is hardcoded to use the java util logging API The commons logging additional component builds a full fledged package renamed commons logging implementation which can be used to replace the implementation provided with Tomcat See the logging page for usage instructions Web Services support JSR 109 Tomcat provides factories for JSR 109 which may be used to resolve web services references Place the generated catalina ws jar as well as jaxrpc jar and wsdl4j jar or another implementation of JSR 109 in the Tomcat lib folder Users should be aware that wsdl4j jar is licensed under CPL 1 0 and not the Apache License version 2 0 JMX Remote

    Original URL path: http://www.llobet.co.cr/docs/extras.html (2015-10-31)
    Open archived version from archive

  • Apache Tomcat 8 (8.0.24) - Apache Tomcat - Using Tomcat libraries with Maven
    17 Default Servlet 18 Clustering 19 Load Balancer 20 Connectors 21 Monitoring and Management 22 Logging 23 APR Native 24 Virtual Hosting 25 Advanced IO 26 Additional Components 27 Mavenized 28 Security Considerations 29 Windows Service 30 Windows Authentication 31 Tomcat s JDBC Pool 32 WebSocket 33 Rewrite Reference Release Notes Configuration Tomcat Javadocs Servlet Javadocs JSP 2 3 Javadocs EL 3 0 Javadocs WebSocket 1 1 Javadocs JK 1 2 Documentation Apache Tomcat Development Building Changelog Status Developers Architecture Functional Specs Tribes Apache Tomcat Using Tomcat libraries with Maven Table of Contents Using Tomcat libraries With Maven Tomcat Snapshots Tomcat Releases Using Tomcat libraries With Maven Tomcat Snapshots Tomcat snapshots are located in the Apache Snapshot Repository The official URL is http people apache org repo m2 snapshot repository org apache tomcat Snapshots are done periodically not on a regular basis but when changes happen and the Tomcat team deems a new snapshot might useful Tomcat Releases Stable releases are published to the Central Maven Repositories The URL for this is http repo2 maven org maven2 org apache tomcat Comments Notice This comments section collects your suggestions on improving documentation for Apache Tomcat If you have trouble and need

    Original URL path: http://www.llobet.co.cr/docs/maven-jars.html (2015-10-31)
    Open archived version from archive

  • Apache Tomcat 8 (8.0.24) - Windows service HOW-TO
    Depends on jvm dll see Jvm Java same as exe but automatically uses the default Java executable i e JAVA HOME bin java exe Make sure JAVA HOME is set correctly or use JavaHome to provide the correct location If neither is set procrun will try to find the default JDK not JRE from the Windows registry exe run the image as a separate process StartImage Executable that will be run Only applies to exe mode StartPath Working path for the start image executable StartClass Main Class that contains the startup method Applies to the jvm and Java modes Not used in exe mode StartMethod main Method name if differs then main StartParams List of parameters that will be passed to either StartImage or StartClass Parameters are separated using either or character StopMode One of jvm Java or exe See StartMode for further details StopImage Executable that will be run on Stop service signal Only applies to exe mode StopPath Working path for the stop image executable Does not apply to jvm mode StopClass Main Class that will be used on Stop service signal Applies to the jvm and Java modes StopMethod main Method name if differs then main StopParams List of parameters that will be passed to either StopImage or StopClass Parameters are separated using either or character StopTimeout No Timeout Defines the timeout in seconds that procrun waits for service to exit gracefully LogPath SystemRoot System32 LogFiles Apache Defines the path for logging Creates the directory if necessary LogPrefix commons daemon Defines the service log filename prefix The log file is created in the LogPath directory with YEAR MONTH DAY log suffix LogLevel Info Defines the logging level and can be either Error Info Warn or Debug Case insensitive StdOutput Redirected stdout filename If named auto then file is created inside LogPath with the name service stdout YEAR MONTH DAY log StdError Redirected stderr filename If named auto then file is created inside LogPath with the name service stderr YEAR MONTH DAY log PidFile Defines the file name for storing the running process id Actual file is created in the LogPath directory Installing services The safest way to manually install the service is to use the provided service bat script Administrator privileges are required to run this script If necessary you can use the user switch to specify a user to use for the installation of the service NOTE On Windows Vista or any later operating system with User Account Control UAC enabled you will be asked for additional privileges when Tomcat8 exe is launched by the script If you want to pass additional options to service installer as PR environment variables you have to either configure them globally in OS or launch the program that sets them with elevated privileges e g right click on cmd exe and select Run as administrator on Windows 8 or later or Windows Server 2012 or later you can open an elevated command prompt for the current directory from the Explorer

    Original URL path: http://www.llobet.co.cr/docs/windows-service-howto.html (2015-10-31)
    Open archived version from archive

  • Apache Tomcat 8 (8.0.24) - Windows Authentication How-To
    name The SPN used in this how to is HTTP win tc01 dev local To map the user to the SPN run the following setspn A HTTP win tc01 dev local tc01 Generate the keytab file that the Tomcat server will use to authenticate itself to the domain controller This file contains the Tomcat private key for the service provider account and should be protected accordingly To generate the file run the following command all on a single line ktpass out c tomcat keytab mapuser tc01 DEV LOCAL princ HTTP win tc01 dev local DEV LOCAL pass tc01pass kvno 0 Create a domain user to be used on the client In this how to the domain user is test with a password of testpass The above steps have been tested on a domain controller running Windows Server 2008 R2 64 bit Standard using the Windows Server 2003 functional level for both the forest and the domain Tomcat instance Windows server These steps assume that Tomcat and a Java 6 JDK JRE have already been installed and configured and that Tomcat is running as the tc01 DEV LOCAL user The steps to configure the Tomcat instance for Windows authentication are as follows Copy the tomcat keytab file created on the domain controller to CATALINA BASE conf tomcat keytab Create the kerberos configuration file CATALINA BASE conf krb5 ini The file used in this how to contained libdefaults default realm DEV LOCAL default keytab name FILE c apache tomcat 8 0 x conf tomcat keytab default tkt enctypes rc4 hmac aes256 cts hmac sha1 96 aes128 cts hmac sha1 96 default tgs enctypes rc4 hmac aes256 cts hmac sha1 96 aes128 cts hmac sha1 96 forwardable true realms DEV LOCAL kdc win dc01 dev local 88 domain realm dev local DEV LOCAL dev local DEV LOCAL The location of this file can be changed by setting the java security krb5 conf system property Create the JAAS login configuration file CATALINA BASE conf jaas conf The file used in this how to contained com sun security jgss krb5 initiate com sun security auth module Krb5LoginModule required doNotPrompt true principal HTTP win tc01 dev local DEV LOCAL useKeyTab true keyTab c apache tomcat 8 0 x conf tomcat keytab storeKey true com sun security jgss krb5 accept com sun security auth module Krb5LoginModule required doNotPrompt true principal HTTP win tc01 dev local DEV LOCAL useKeyTab true keyTab c apache tomcat 8 0 x conf tomcat keytab storeKey true The location of this file can be changed by setting the java security auth login config system property The LoginModule used is a JVM specific one so ensure that the LoginModule specified matches the JVM being used The name of the login configuration must match the value used by the authentication valve The SPNEGO authenticator will work with any Realm but if used with the JNDI Realm by default the JNDI Realm will use the user s delegated credentials to connect to the Active Directory The

    Original URL path: http://www.llobet.co.cr/docs/windows-auth-howto.html (2015-10-31)
    Open archived version from archive

  • Apache Tomcat 8 (8.0.24) - The Tomcat JDBC Connection Pool
    load using the thread context loader Set this value to true if you wish to remain backwards compatible with Apache Tomcat 8 0 8 and earlier and only attempt the current loader If not set then the default value is false Common Attributes These attributes are shared between commons dbcp and tomcat jdbc pool in some cases default values are different Attribute Description defaultAutoCommit boolean The default auto commit state of connections created by this pool If not set default is JDBC driver default If not set then the setAutoCommit method will not be called defaultReadOnly boolean The default read only state of connections created by this pool If not set then the setReadOnly method will not be called Some drivers don t support read only mode ex Informix defaultTransactionIsolation String The default TransactionIsolation state of connections created by this pool One of the following see javadoc NONE READ COMMITTED READ UNCOMMITTED REPEATABLE READ SERIALIZABLE If not set the method will not be called and it defaults to the JDBC driver defaultCatalog String The default catalog of connections created by this pool driverClassName String The fully qualified Java class name of the JDBC driver to be used The driver has to be accessible from the same classloader as tomcat jdbc jar username String The connection username to be passed to our JDBC driver to establish a connection Note that method DataSource getConnection username password by default will not use credentials passed into the method but will use the ones configured here See alternateUsernameAllowed property for more details password String The connection password to be passed to our JDBC driver to establish a connection Note that method DataSource getConnection username password by default will not use credentials passed into the method but will use the ones configured here See alternateUsernameAllowed property for more details maxActive int The maximum number of active connections that can be allocated from this pool at the same time The default value is 100 maxIdle int The maximum number of connections that should be kept in the pool at all times Default value is maxActive 100 Idle connections are checked periodically if enabled and connections that been idle for longer than minEvictableIdleTimeMillis will be released also see testWhileIdle minIdle int The minimum number of established connections that should be kept in the pool at all times The connection pool can shrink below this number if validation queries fail Default value is derived from initialSize 10 also see testWhileIdle initialSize int The initial number of connections that are created when the pool is started Default value is 10 maxWait int The maximum number of milliseconds that the pool will wait when there are no available connections for a connection to be returned before throwing an exception Default value is 30000 30 seconds testOnBorrow boolean The indication of whether objects will be validated before being borrowed from the pool If the object fails to validate it will be dropped from the pool and we will attempt to borrow another NOTE for a true value to have any effect the validationQuery or validatorClassName parameter must be set to a non null string In order to have a more efficient validation see validationInterval Default value is false testOnConnect boolean The indication of whether objects will be validated when a connection is first created If an object fails to validate it will be throw SQLException NOTE for a true value to have any effect the validationQuery initSQL or validatorClassName parameter must be set to a non null string Default value is false testOnReturn boolean The indication of whether objects will be validated before being returned to the pool NOTE for a true value to have any effect the validationQuery or validatorClassName parameter must be set to a non null string The default value is false testWhileIdle boolean The indication of whether objects will be validated by the idle object evictor if any If an object fails to validate it will be dropped from the pool NOTE for a true value to have any effect the validationQuery or validatorClassName parameter must be set to a non null string The default value is false and this property has to be set in order for the pool cleaner test thread is to run also see timeBetweenEvictionRunsMillis validationQuery String The SQL query that will be used to validate connections from this pool before returning them to the caller If specified this query does not have to return any data it just can t throw a SQLException The default value is null Example values are SELECT 1 mysql select 1 from dual oracle SELECT 1 MS Sql Server validationQueryTimeout int The timeout in seconds before a connection validation queries fail This works by calling java sql Statement setQueryTimeout seconds on the statement that executes the validationQuery The pool itself doesn t timeout the query it is still up to the JDBC driver to enforce query timeouts A value less than or equal to zero will disable this feature The default value is 1 validatorClassName String The name of a class which implements the org apache tomcat jdbc pool Validator interface and provides a no arg constructor may be implicit If specified the class will be used to create a Validator instance which is then used instead of any validation query to validate connections The default value is null An example value is com mycompany project SimpleValidator timeBetweenEvictionRunsMillis int The number of milliseconds to sleep between runs of the idle connection validation cleaner thread This value should not be set under 1 second It dictates how often we check for idle abandoned connections and how often we validate idle connections The default value is 5000 5 seconds numTestsPerEvictionRun int Property not used in tomcat jdbc pool minEvictableIdleTimeMillis int The minimum amount of time an object may sit idle in the pool before it is eligible for eviction The default value is 60000 60 seconds accessToUnderlyingConnectionAllowed boolean Property not used Access can be achieved by calling unwrap on the pooled connection see javax sql DataSource interface or call getConnection through reflection or cast the object as javax sql PooledConnection removeAbandoned boolean Flag to remove abandoned connections if they exceed the removeAbandonedTimeout If set to true a connection is considered abandoned and eligible for removal if it has been in use longer than the removeAbandonedTimeout Setting this to true can recover db connections from applications that fail to close a connection See also logAbandoned The default value is false removeAbandonedTimeout int Timeout in seconds before an abandoned in use connection can be removed The default value is 60 60 seconds The value should be set to the longest running query your applications might have logAbandoned boolean Flag to log stack traces for application code which abandoned a Connection Logging of abandoned Connections adds overhead for every Connection borrow because a stack trace has to be generated The default value is false connectionProperties String The connection properties that will be sent to our JDBC driver when establishing new connections Format of the string must be propertyName property NOTE The user and password properties will be passed explicitly so they do not need to be included here The default value is null poolPreparedStatements boolean Property not used maxOpenPreparedStatements int Property not used Tomcat JDBC Enhanced Attributes Attribute Description initSQL String A custom query to be run when a connection is first created The default value is null jdbcInterceptors String A semicolon separated list of classnames extending org apache tomcat jdbc pool JdbcInterceptor class See Configuring JDBC interceptors below for more detailed description of syntaz and examples These interceptors will be inserted as an interceptor into the chain of operations on a java sql Connection object The default value is null Predefined interceptors org apache tomcat jdbc pool interceptor ConnectionState keeps track of auto commit read only catalog and transaction isolation level org apache tomcat jdbc pool interceptor StatementFinalizer keeps track of opened statements and closes them when the connection is returned to the pool More predefined interceptors are described in detail in the JDBC Interceptors section validationInterval long avoid excess validation only run validation at most at this frequency time in milliseconds If a connection is due for validation but has been validated previously within this interval it will not be validated again The default value is 30000 30 seconds jmxEnabled boolean Register the pool with JMX or not The default value is true fairQueue boolean Set to true if you wish that calls to getConnection should be treated fairly in a true FIFO fashion This uses the org apache tomcat jdbc pool FairBlockingQueue implementation for the list of the idle connections The default value is true This flag is required when you want to use asynchronous connection retrieval Setting this flag ensures that threads receive connections in the order they arrive During performance tests there is a very large difference in how locks and lock waiting is implemented When fairQueue true there is a decision making process based on what operating system the system is running If the system is running on Linux property os name Linux To disable this Linux specific behavior and still use the fair queue simply add the property org apache tomcat jdbc pool FairBlockingQueue ignoreOS true to your system properties before the connection pool classes are loaded abandonWhenPercentageFull int Connections that have been abandoned timed out wont get closed and reported up unless the number of connections in use are above the percentage defined by abandonWhenPercentageFull The value should be between 0 100 The default value is 0 which implies that connections are eligible for closure as soon as removeAbandonedTimeout has been reached maxAge long Time in milliseconds to keep this connection When a connection is returned to the pool the pool will check to see if the now time when connected maxAge has been reached and if so it closes the connection rather than returning it to the pool The default value is 0 which implies that connections will be left open and no age check will be done upon returning the connection to the pool useEquals boolean Set to true if you wish the ProxyConnection class to use String equals and set to false when you wish to use when comparing method names This property does not apply to added interceptors as those are configured individually The default value is true suspectTimeout int Timeout value in seconds Default value is 0 Similar to to the removeAbandonedTimeout value but instead of treating the connection as abandoned and potentially closing the connection this simply logs the warning if logAbandoned is set to true If this value is equal or less than 0 no suspect checking will be performed Suspect checking only takes place if the timeout value is larger than 0 and the connection was not abandoned or if abandon check is disabled If a connection is suspect a WARN message gets logged and a JMX notification gets sent once rollbackOnReturn boolean If autoCommit false then the pool can terminate the transaction by calling rollback on the connection as it is returned to the pool Default value is false commitOnReturn boolean If autoCommit false then the pool can complete the transaction by calling commit on the connection as it is returned to the pool If rollbackOnReturn true then this attribute is ignored Default value is false alternateUsernameAllowed boolean By default the jdbc pool will ignore the DataSource getConnection username password call and simply return a previously pooled connection under the globally configured properties username and password for performance reasons The pool can however be configured to allow use of different credentials each time a connection is requested To enable the functionality described in the DataSource getConnection username password call simply set the property alternateUsernameAllowed to true Should you request a connection with the credentials user1 password1 and the connection was previously connected using different user2 password2 the connection will be closed and reopened with the requested credentials This way the pool size is still managed on a global level and not on a per schema level The default value is false This property was added as an enhancement to bug 50025 dataSource javax sql DataSource Inject a data source to the connection pool and the pool will use the data source to retrieve connections instead of establishing them using the java sql Driver interface This is useful when you wish to pool XA connections or connections established using a data source instead of a connection string Default value is null dataSourceJNDI String The JNDI name for a data source to be looked up in JNDI and then used to establish connections to the database See the dataSource attribute Default value is null useDisposableConnectionFacade boolean Set this to true if you wish to put a facade on your connection so that it cannot be reused after it has been closed This prevents a thread holding on to a reference of a connection it has already called closed on to execute queries on it Default value is true logValidationErrors boolean Set this to true to log errors during the validation phase to the log file If set to true errors will be logged as SEVERE Default value is false for backwards compatibility propagateInterruptState boolean Set this to true to propagate the interrupt state for a thread that has been interrupted not clearing the interrupt state Default value is false for backwards compatibility ignoreExceptionOnPreLoad boolean Flag whether ignore error of connection creation while initializing the pool Set to true if you want to ignore error of connection creation while initializing the pool Set to false if you want to fail the initialization of the pool by throwing exception The default value is false Advanced usage JDBC interceptors To see an example of how to use an interceptor take a look at org apache tomcat jdbc pool interceptor ConnectionState This simple interceptor is a cache of three attributes transaction isolation level auto commit and read only state in order for the system to avoid not needed roundtrips to the database Further interceptors will be added to the core of the pool as the need arises Contributions are always welcome Interceptors are of course not limited to just java sql Connection but can be used to wrap any of the results from a method invokation as well You could build query performance analyzer that provides JMX notifications when a query is running longer than the expected time Configuring JDBC interceptors Configuring JDBC interceptors is done using the jdbcInterceptors property The property contains a list of semicolon separated class names If the classname is not fully qualified it will be prefixed with the org apache tomcat jdbc pool interceptor prefix Example jdbcInterceptors org apache tomcat jdbc pool interceptor ConnectionState org apache tomcat jdbc pool interceptor StatementFinalizer is the same as jdbcInterceptors ConnectionState StatementFinalizer Interceptors can have properties as well Properties for an interceptor are specified within parentheses after the class name Several properties are separated by commas Example jdbcInterceptors ConnectionState StatementFinalizer useEquals true Extra whitespace characters around class names property names and values are ignored org apache tomcat jdbc pool JdbcInterceptor Abstract base class for all interceptors can not be instantiated Attribute Description useEquals boolean Set to true if you wish the ProxyConnection class to use String equals and set to false when you wish to use when comparing method names The default value is true org apache tomcat jdbc pool interceptor ConnectionState Caches the connection for the following attributes autoCommit readOnly transactionIsolation and catalog It is a performance enhancement to avoid roundtrip to the database when getters are called or setters are called with an already set value Attribute Description org apache tomcat jdbc pool interceptor StatementFinalizer Keeps track of all statements created using createStatement prepareStatement or prepareCall and closes these statements when the connection is returned to the pool Attribute Description trace boolean as String Enable tracing of unclosed statements When enabled and a connection is closed and statements are not closed the interceptor will log all stack traces The default value is false org apache tomcat jdbc pool interceptor StatementCache Caches PreparedStatement and or CallableStatement instances on a connection The statements are cached per connection The count limit is counted globally for all connections that belong to the same pool Once the count reaches max subsequent statements are not returned to the cache and are closed immediately Attribute Description prepared boolean as String Enable caching of PreparedStatement instances created using prepareStatement calls The default value is true callable boolean as String Enable caching of CallableStatement instances created using prepareCall calls The default value is false max int as String Limit on the count of cached statements across the connection pool The default value is 50 org apache tomcat jdbc pool interceptor StatementDecoratorInterceptor See 48392 Interceptor to wrap statements and result sets in order to prevent access to the actual connection using the methods ResultSet getStatement getConnection and Statement getConnection Attribute Description org apache tomcat jdbc pool interceptor QueryTimeoutInterceptor Automatically calls java sql Statement setQueryTimeout seconds when a new statement is created The pool itself doesn t timeout the query it is still up to the JDBC driver to enforce query timeouts Attribute Description queryTimeout int as String The number of seconds to set for the query timeout The default value is 1000 milliseconds org apache tomcat jdbc pool interceptor SlowQueryReport Keeps track of query performance and issues log entries when queries exceed a time threshold of fail The log level used is WARN Attribute Description threshold int as String The number of milliseconds a query has to exceed before issuing a log alert The default value is 1000 milliseconds maxQueries int as String The maximum number of queries to keep track of in order to preserve memory space The default value is 1000 logSlow boolean as String Set to true if you wish to log slow queries The default value is true logFailed boolean as String Set to true if you wish to log failed queries The default value

    Original URL path: http://www.llobet.co.cr/docs/jdbc-pool.html (2015-10-31)
    Open archived version from archive

  • Apache Tomcat 8 (8.0.24) - WebSocket How-To
    been reported 56304 that Linux can take large numbers of minutes to report dropped connections When using WebSocket with the BIO HTTP connector this can result in threads blocking on writes for this period This is likely to be undesirable The time taken for the connection to be reported as dropped can be reduced by using the kernel network parameter proc sys net ipv4 tcp retries2 Alternatively one of the other HTTP connectors may be used as they utilise non blocking IO enabling Tomcat to implement its own timeout mechanism to handle these cases Tomcat WebSocket specific configuration Tomcat provides a number of Tomcat specific configuration options for WebSocket It is anticipated that these will be absorbed into the WebSocket specification over time The write timeout used when sending WebSocket messages in blocking mode defaults to 20000 milliseconds 20 seconds This may be changed by setting the property org apache tomcat websocket BLOCKING SEND TIMEOUT in the user properties collection attached to the WebSocket session The value assigned to this property should be a Long and represents the timeout to use in milliseconds For an infinite timeout use 1 If the application does not define a MessageHandler Partial for incoming binary messages any incoming binary messages must be buffered so the entire message can be delivered in a single call to the registered MessageHandler Whole for binary messages The default buffer size for binary messages is 8192 bytes This may be changed for a web application by setting the servlet context initialization parameter org apache tomcat websocket binaryBufferSize to the desired value in bytes If the application does not define a MessageHandler Partial for incoming text messages any incoming text messages must be buffered so the entire message can be delivered in a single call to the registered MessageHandler Whole for text messages The default buffer size for text messages is 8192 bytes This may be changed for a web application by setting the servlet context initialization parameter org apache tomcat websocket textBufferSize to the desired value in bytes The Java WebSocket specification 1 0 does not permit programmatic deployment after the first endpoint has started a WebSocket handshake By default Tomcat continues to permit additional programmatic deployment This behavior is controlled by the org apache tomcat websocket noAddAfterHandshake servlet context initialization parameter The default may be changed by setting the org apache tomcat websocket STRICT SPEC COMPLIANCE system property to true but any explicit setting on the servlet context will always take priority The Java WebSocket 1 0 specification requires that callbacks for asynchronous writes are performed on a different thread to the thread that initiated the write Since the container thread pool is not exposed via the Servlet API the WebSocket implementation has to provide its own thread pool This thread pool is controlled by the following servlet context initialization parameters org apache tomcat websocket executorCoreSize The core size of the executor thread pool If not set the default of 0 zero is used Note that the maximum

    Original URL path: http://www.llobet.co.cr/docs/web-socket-howto.html (2015-10-31)
    Open archived version from archive

  • Apache Tomcat 8 (8.0.24) - The rewrite Valve
    is a directory f is regular f ile Treats the TestString as a pathname and tests whether or not it exists and is a regular file s is regular file with s ize Treats the TestString as a pathname and tests whether or not it exists and is a regular file with size greater than zero Note All of these tests can also be prefixed by an exclamation mark to negate their meaning You can also set special flags for CondPattern by appending flags as the third argument to the RewriteCond directive where flags is a comma separated list of any of the following flags nocase NC n o c ase This makes the test case insensitive differences between A Z and a z are ignored both in the expanded TestString and the CondPattern This flag is effective only for comparisons between TestString and CondPattern It has no effect on file system and subrequest checks ornext OR or next condition Use this to combine rule conditions with a local OR instead of the implicit AND Typical example RewriteCond REMOTE HOST host1 OR RewriteCond REMOTE HOST host2 OR RewriteCond REMOTE HOST host3 RewriteRule some special stuff for any of these hosts Without this flag you would have to write the condition rule pair three times Example To rewrite the Homepage of a site according to the User Agent header of the request you can use the following RewriteCond HTTP USER AGENT Mozilla RewriteRule homepage max html L RewriteCond HTTP USER AGENT Lynx RewriteRule homepage min html L RewriteRule homepage std html L Explanation If you use a browser which identifies itself as Mozilla including Netscape Navigator Mozilla etc then you get the max homepage which could include frames or other special features If you use the Lynx browser which is terminal based then you get the min homepage which could be a version designed for easy text only browsing If neither of these conditions apply you use any other browser or your browser identifies itself as something non standard you get the std standard homepage RewriteMap Syntax RewriteMap name rewriteMapClassName optionalParameters The maps are implemented using an interface that users must implement Its class name is org apache catalina valves rewrite RewriteMap and its code is package org apache catalina valves rewrite public interface RewriteMap public String setParameters String params public String lookup String key RewriteRule Syntax RewriteRule Pattern Substitution The RewriteRule directive is the real rewriting workhorse The directive can occur more than once with each instance defining a single rewrite rule The order in which these rules are defined is important this is the order in which they will be applied at run time Pattern is a perl compatible regular expression which is applied to the current URL Current means the value of the URL when this rule is applied This may not be the originally requested URL which may already have matched a previous rule and have been altered Some hints on the syntax of regular expressions Text Any single character chars Character class Any character of the class chars chars Character class Not a character of the class chars text1 text2 Alternative text1 or text2 Quantifiers 0 or 1 occurrences of the preceding text 0 or N occurrences of the preceding text N 0 1 or N occurrences of the preceding text N 1 Grouping text Grouping of text used either to set the borders of an alternative as above or to make backreferences where the N th group can be referred to on the RHS of a RewriteRule as N Anchors Start of line anchor End of line anchor Escaping char escape the given char for instance to specify the chars etc For more information about regular expressions have a look at the perl regular expression manpage perldoc perlre If you are interested in more detailed information about regular expressions and their variants POSIX regex etc the following book is dedicated to this topic Mastering Regular Expressions 2nd Edition Jeffrey E F Friedl O Reilly Associates Inc 2002 ISBN 978 0 596 00289 3 In the rules the NOT character is also available as a possible pattern prefix This enables you to negate a pattern to say for instance if the current URL does NOT match this pattern This can be used for exceptional cases where it is easier to match the negative pattern or as a last default rule Note When using the NOT character to negate a pattern you cannot include grouped wildcard parts in that pattern This is because when the pattern does NOT match i e the negation matches there are no contents for the groups Thus if negated patterns are used you cannot use N in the substitution string The substitution of a rewrite rule is the string which is substituted for or replaces the original URL which Pattern matched In addition to plain text it can include back references N to the RewriteRule pattern back references N to the last matched RewriteCond pattern server variables as in rule condition test strings VARNAME mapping function calls mapname key default Back references are identifiers of the form N N 0 9 which will be replaced by the contents of the N th group of the matched Pattern The server variables are the same as for the TestString of a RewriteCond directive The mapping functions come from the RewriteMap directive and are explained there These three types of variables are expanded in the order above As already mentioned all rewrite rules are applied to the Substitution in the order in which they are defined in the config file The URL is completely replaced by the Substitution and the rewriting process continues until all rules have been applied or it is explicitly terminated by a L flag There is a special substitution string named which means NO substitution This is useful in providing rewriting rules which only match URLs but do not substitute anything for them It is commonly used in conjunction with the

    Original URL path: http://www.llobet.co.cr/docs/rewrite.html (2015-10-31)
    Open archived version from archive



  •