Package webapp

Source Code of webapp.AppUtils

/**
* Copyright (C) 2006 - present dabuTech Corporation
* All Rights Reserved.
*
* This file is part of Easier Java Websites.
*
* EJW is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the accompanying license
* for more details.
*
* You should have received a copy of the license along with EJW; if not,
* go to http://www.EasierJava.com and download the latest version.
*/

package webapp;

import com.swabunga.spell.engine.GenericSpellDictionary;
import com.swabunga.spell.engine.SpellDictionary;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import javax.servlet.ServletConfig;
import ejw.InitDestroyHandler;

public class AppUtils extends InitDestroyHandler
  {
    static SpellDictionary spellDictionary;
   
    public void init(ServletConfig config) throws MalformedURLException, URISyntaxException, FileNotFoundException, IOException
      {
        File file = new File(config.getServletContext().getRealPath("/WEB-INF/dictionary/english.0"));
        spellDictionary = new GenericSpellDictionary(file);
        spellDictionary.addWord("a");
      }
   
    public static SpellDictionary getSpeller() { return spellDictionary; }
  }
TOP

Related Classes of webapp.AppUtils

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.