diff --git a/config/lex-context-config.xml b/config/lex-context-config.xml index 497d9f0..6bec1d1 100644 --- a/config/lex-context-config.xml +++ b/config/lex-context-config.xml @@ -11,7 +11,7 @@ url - jdbc:mysql://localhost/Lex + jdbc:mysql://localhost/Lex?useUnicode=true&characterEncoding=UTF-8 driverClassName @@ -25,14 +25,6 @@ password password - - useUnicode - true - - - characterEncoding - utf-8 - diff --git a/config/web.xml b/config/web.xml index 9b6b41d..20bc8f6 100644 --- a/config/web.xml +++ b/config/web.xml @@ -21,11 +21,21 @@ org.thdl.lex.GuestFilter + + charEnc + org.thdl.lex.CharEncFilter + + component org.thdl.lex.LexComponentFilter + + charEnc + /action + + authentication /action diff --git a/src/java/org/thdl/lex/LexActionServlet.java b/src/java/org/thdl/lex/LexActionServlet.java index 4b98391..22e7e16 100644 --- a/src/java/org/thdl/lex/LexActionServlet.java +++ b/src/java/org/thdl/lex/LexActionServlet.java @@ -90,9 +90,6 @@ public class LexActionServlet extends HttpServlet */ public void service( HttpServletRequest req, HttpServletResponse res ) throws ServletException, IOException { - res.setContentType( "text/html; charset=UTF-8;" ); - req.setCharacterEncoding( "UTF-8" ); - /* LexLogger.debug( "Checking Request state at start of LexActionServlet.service()" ); LexLogger.logRequestState( req ); diff --git a/src/java/org/thdl/lex/LexComponentFilter.java b/src/java/org/thdl/lex/LexComponentFilter.java index 700ea60..ec5c94d 100644 --- a/src/java/org/thdl/lex/LexComponentFilter.java +++ b/src/java/org/thdl/lex/LexComponentFilter.java @@ -138,7 +138,11 @@ public class LexComponentFilter implements Filter long start = System.currentTimeMillis(); if ( request instanceof HttpServletRequest && response instanceof HttpServletResponse ) { + HttpServletResponse res = (HttpServletResponse) response; HttpServletRequest req = (HttpServletRequest) request; + res.setContentType( "text/html; charset=UTF-8;" ); + req.setCharacterEncoding( "UTF-8" ); + if ( null != req.getParameter( LexConstants.LABEL_REQ_PARAM ) ) { String labelValue = req.getParameter( LexConstants.LABEL_REQ_PARAM ); diff --git a/src/java/org/thdl/lex/commands/InsertCommand.java b/src/java/org/thdl/lex/commands/InsertCommand.java index 7f39886..811fcfd 100644 --- a/src/java/org/thdl/lex/commands/InsertCommand.java +++ b/src/java/org/thdl/lex/commands/InsertCommand.java @@ -76,11 +76,15 @@ public class InsertCommand extends LexCommand implements Command if ( CommandToken.isValid( req ) && validate( user, component ) ) { - LexComponentRepository.update( term ); + if ( !isTermMode() ) + { + LexComponentRepository.update( term ); + } + if ( isTermMode() ) { - term.populate( req.getParameterMap() ); - component = term; + term = (ITerm) component; + //term.populate( req.getParameterMap() ); } else if ( component instanceof AnalyticalNote ) { diff --git a/src/jsp/jsp/displayDefinition.jsf b/src/jsp/jsp/displayDefinition.jsf index 4e2bfa7..d8ec152 100644 --- a/src/jsp/jsp/displayDefinition.jsf +++ b/src/jsp/jsp/displayDefinition.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displayEncyclopediaArticle.jsf b/src/jsp/jsp/displayEncyclopediaArticle.jsf index cda1833..f4b3746 100644 --- a/src/jsp/jsp/displayEncyclopediaArticle.jsf +++ b/src/jsp/jsp/displayEncyclopediaArticle.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displayEntry.jsp b/src/jsp/jsp/displayEntry.jsp index da93b1a..0fdd358 100644 --- a/src/jsp/jsp/displayEntry.jsp +++ b/src/jsp/jsp/displayEntry.jsp @@ -1,6 +1,7 @@ -<%@ page buffer="512kb" autoFlush="false" import="org.thdl.lex.*,org.thdl.lex.component.*" errorPage="/jsp/error.jsp" pageEncoding="UTF-8" contentType="text/html"%> +<%@ page buffer="512kb" autoFlush="false" import="org.thdl.lex.*,org.thdl.lex.component.*" errorPage="/jsp/error.jsp" contentType="text/html; charset=UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> -<% request.setCharacterEncoding("UTF-8"); %> +<% request.setCharacterEncoding("UTF-8"); %> + @@ -118,6 +119,8 @@

+

The requires the TibetanMachineWeb font to display Tibetan script.

+
diff --git a/src/jsp/jsp/displayEtymology.jsf b/src/jsp/jsp/displayEtymology.jsf index 9495430..7020da9 100644 --- a/src/jsp/jsp/displayEtymology.jsf +++ b/src/jsp/jsp/displayEtymology.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displayForm.jsp b/src/jsp/jsp/displayForm.jsp index a4232fb..08b2be2 100644 --- a/src/jsp/jsp/displayForm.jsp +++ b/src/jsp/jsp/displayForm.jsp @@ -1,5 +1,6 @@ <%@ page buffer="512kb" autoFlush="false" import="org.thdl.lex.*,org.thdl.lex.component.*" errorPage="/jsp/error.jsp" contentType="text/html; charset=UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<% request.setCharacterEncoding("UTF-8"); %> diff --git a/src/jsp/jsp/displayFunction.jsf b/src/jsp/jsp/displayFunction.jsf index 4c4231b..6fc84f4 100644 --- a/src/jsp/jsp/displayFunction.jsf +++ b/src/jsp/jsp/displayFunction.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displayKeyword.jsf b/src/jsp/jsp/displayKeyword.jsf index 25dc73b..3adeacf 100644 --- a/src/jsp/jsp/displayKeyword.jsf +++ b/src/jsp/jsp/displayKeyword.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displayMeta.jsf b/src/jsp/jsp/displayMeta.jsf index 74f02ef..fca7841 100644 --- a/src/jsp/jsp/displayMeta.jsf +++ b/src/jsp/jsp/displayMeta.jsf @@ -1,4 +1,4 @@ -<%@ page contentType="text/html; charset=UTF-8"%> +<%@ page %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displayModelSentence.jsf b/src/jsp/jsp/displayModelSentence.jsf index a49f95d..c29e6c3 100644 --- a/src/jsp/jsp/displayModelSentence.jsf +++ b/src/jsp/jsp/displayModelSentence.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displayNotes.jsf b/src/jsp/jsp/displayNotes.jsf index d107b6c..2e908da 100644 --- a/src/jsp/jsp/displayNotes.jsf +++ b/src/jsp/jsp/displayNotes.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displayPassage.jsf b/src/jsp/jsp/displayPassage.jsf index a4a4028..6f7fa01 100644 --- a/src/jsp/jsp/displayPassage.jsf +++ b/src/jsp/jsp/displayPassage.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displayPronunciation.jsf b/src/jsp/jsp/displayPronunciation.jsf index e6ada39..e48231d 100644 --- a/src/jsp/jsp/displayPronunciation.jsf +++ b/src/jsp/jsp/displayPronunciation.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displayRegister.jsf b/src/jsp/jsp/displayRegister.jsf index 0ce50b9..dc0cb60 100644 --- a/src/jsp/jsp/displayRegister.jsf +++ b/src/jsp/jsp/displayRegister.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displayRelatedTerm.jsf b/src/jsp/jsp/displayRelatedTerm.jsf index 4162e6d..e2eec88 100644 --- a/src/jsp/jsp/displayRelatedTerm.jsf +++ b/src/jsp/jsp/displayRelatedTerm.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displaySpelling.jsf b/src/jsp/jsp/displaySpelling.jsf index 6a9d2bc..5ad1f19 100644 --- a/src/jsp/jsp/displaySpelling.jsf +++ b/src/jsp/jsp/displaySpelling.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displaySubdefinition.jsf b/src/jsp/jsp/displaySubdefinition.jsf index 3e8618d..4c601fd 100644 --- a/src/jsp/jsp/displaySubdefinition.jsf +++ b/src/jsp/jsp/displaySubdefinition.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displayTerm.jsf b/src/jsp/jsp/displayTerm.jsf index 111c351..4a8da85 100644 --- a/src/jsp/jsp/displayTerm.jsf +++ b/src/jsp/jsp/displayTerm.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page buffer="512kb" autoFlush="false" import="org.thdl.lex.*,org.thdl.lex.component.*" errorPage="/jsp/error.jsp"%> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> @@ -39,7 +39,7 @@ -

+

diff --git a/src/jsp/jsp/displayTransitionalData.jsf b/src/jsp/jsp/displayTransitionalData.jsf index 565f836..ae5351f 100644 --- a/src/jsp/jsp/displayTransitionalData.jsf +++ b/src/jsp/jsp/displayTransitionalData.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displayTranslationEquivalent.jsf b/src/jsp/jsp/displayTranslationEquivalent.jsf index d72fce6..19f2914 100644 --- a/src/jsp/jsp/displayTranslationEquivalent.jsf +++ b/src/jsp/jsp/displayTranslationEquivalent.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displayTree.jsf b/src/jsp/jsp/displayTree.jsf index fcf1e19..b3ac84f 100644 --- a/src/jsp/jsp/displayTree.jsf +++ b/src/jsp/jsp/displayTree.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/displayTreeToc.jsf b/src/jsp/jsp/displayTreeToc.jsf index 3d1adba..7c6bcc3 100644 --- a/src/jsp/jsp/displayTreeToc.jsf +++ b/src/jsp/jsp/displayTreeToc.jsf @@ -1,4 +1,4 @@ -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" contentType="text/html; charset=UTF-8" %> +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> diff --git a/src/jsp/jsp/footer.jsf b/src/jsp/jsp/footer.jsf index a54a14f..a776a64 100644 --- a/src/jsp/jsp/footer.jsf +++ b/src/jsp/jsp/footer.jsf @@ -1,6 +1,5 @@ -<%@ page import="org.thdl.lex.LexLogger" contentType="text/html; charset=UTF-8" %> +<%@ page import="org.thdl.lex.LexLogger" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> -<%@ taglib prefix = "req" uri = "http://jakarta.apache.org/taglibs/request-1.0" %> <%-- diff --git a/src/jsp/jsp/header.jsf b/src/jsp/jsp/header.jsf index 61af465..565335a 100644 --- a/src/jsp/jsp/header.jsf +++ b/src/jsp/jsp/header.jsf @@ -4,7 +4,7 @@ - + diff --git a/src/jsp/jsp/menu.jsp b/src/jsp/jsp/menu.jsp index e338297..660fd1b 100644 --- a/src/jsp/jsp/menu.jsp +++ b/src/jsp/jsp/menu.jsp @@ -1,6 +1,7 @@ <%@ page buffer="512kb" autoFlush="false" import="org.thdl.lex.*,org.thdl.lex.component.*" errorPage="/jsp/error.jsp" contentType="text/html; charset=UTF-8"%> - <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<% request.setCharacterEncoding("UTF-8"); %> + @@ -80,7 +81,7 @@

- +

@@ -88,6 +89,7 @@

+ The requires the TibetanMachineWeb font to display Tibetan script.
diff --git a/src/jsp/jsp/navLinks.jsf b/src/jsp/jsp/navLinks.jsf index add9d2b..d098c9b 100644 --- a/src/jsp/jsp/navLinks.jsf +++ b/src/jsp/jsp/navLinks.jsf @@ -1,4 +1,4 @@ -<%@ page contentType="text/html; charset=UTF-8"%> +<%@ page %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>