Mapping subdirectory with html files to JSP servlet - html

I understand that I can map HTML files such that the JSP engine treats files with .html extensions the same as they do for .jsp files. However, what I wish to do is more precise than that. I want my JSP engine, Tomcat 5.5, to treat only those HTML files in a specific subdirectory, SecAuth, as JSP files.
I added the following in Tomcat's web.xml file and it did not work (in fact, an error ensued):
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>SecAuth/*.html</url-pattern>
</servlet-mapping>
Is it clear what I'm trying to accomplish? Any help would be appreciated.
Thank you.

Related

How to host website on github with HTML and CSS preprocessor format?

I have created a new repository and and included all files necessary to host a website on github, see (https://github.com/tonystaark/tonystaark.github.io/tree/master)
However, I received a 404 error when I visited my own website at tonystaark.github.io. The error says that 'For root URLs (like http://example.com/) you must provide an index.html file.'
How do I convert my .pug format into a html (or .postcss into a .css) file then?
You can easily generate html from pug file using command line option,
pug -O '{"doctype": "html"}' index.pug
It's automatically generate index.html file for you.You can check other options from here
Pug files need to be compiled onto the server before being served as an HTML file. There aren't many great ways to compile Pug in the client. If you have a strong need to use Pug as a templating engine, GitHub Pages will not be able to do that. You will need to host your site somewhere that supports Node.js engines (Heroku, DigitalOcean, Amazon S3, etc.)
I didn't see any Pug files in your GitHub repo, though, so I don't know if you figured out another solution or tried to do something else.

Is it possible to access a html outside of webapp?

I have a process to generate html file dynamically, but i dont want to place those html files under the webapp, because if the project are re-deployed, I have to deal with the existing html files(copy out and copy in).
So I'm just wondering if I can place the html files outside of the webapp.
If not, is there any other proper way to meet the requriement?
I'm using tomcat.
Appropriate your help.
Create below dir if not exist:
${CATALINA_HOME}/conf/Catalina/localhost
Create a xml file "article.xml", place the xml under the above path as follows.
${CATALINA_HOME}/conf/Catalina/localhost/article.xml
Add below content to the xml.
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/article" docBase="C:/apps/blog/article" debug="0"
reloadable="true" privileged="true">
</Context>
Start tomcat.
If there's aa.html under the C:/apps/blog/article, use http://localhost:8080/article/aa.html to access the html.
NOTE:
1. Tomcat will take the xml as an web application, and load the resource configed in the xml.
2. No need to create WEB-INF and META-INF for the external folder(C:/apps/blog/article here).

Can we create Joomla custom template with HTML

I'm new to Joomla.
I'm having a small doubt coming to creating Joomla templates. In the file structure provided by joomla I can see only index.php file. My doubt is can we create a Joomla template using HTML also. so that in the file structure it reads index.html.
Thanks in Advance and Merry Christmas.
It is important here to distinguish between "can" and "should" here. I believe you "can" make a template in an html file without losing all of the Joomla functionality because Joomla places modules using tags like <jdoc:include type="modules" name="user4" /> which it will parse. I'm not positive, but fairly certain that the template does require a php to bootstrap it, but you could just have the php file include the html you want to use. The major drawback is that you will be losing all of the php helper methods that Joomla makes available for you, like JURI::base() for dealing with paths for your scripts/css, etc.
You definitely should take advantage of Joomla's capabilities with php, so use the php file. If you want to include some html files into that document, that's just fine.
I don't think you can do that. The index.php file you are referring to is the root index file, while each template has its own index.php file inside their folder inside templates folder. For example templates/beez3/index.php Joomla includes the index.php file of the chosen template during it's execution cycle. Failing to find such a file it will fall back to a preinstalled template throwing an error: The template for this display is not available. Also the frontend requests start by loading the root index.php file first and then proceed to other calls and <jdoc:include type="component" /> won't load anything as it won't have any framework loaded or any joomla functionality at all. Finally no extension will work since they all require the _JEXEC constant to be defined as it's being defined in the root index.php file:
/**
* Constant that is checked in included files to prevent direct access.
* define() is used in the installation folder rather than "const" to not error for PHP 5.2 and lower
*/
define('_JEXEC', 1);
It must be written in php and you can certainly keep your theme that you created within the template folder, as for keeping .html you can always use htaccess to serve whichever extension you want.

XML: rendered as an HTML file in URL

I've been given the task of rendering an xml file via xsl as html. This means it appears as /.../index.xml in the URL.
However, the task requests that the xml file renders in the URL at /.../index.html.
Currently it renders as index.xml not .html - how do I achieve this?
Any ideas/resources would be great, thanks.
One simple way to satisfy the requirement (there are others, no doubt) is to configure your server to redirect index.html to index.xml. How you do that depends on which Web server you are using; consult the documentation for your server. If you're using Apache, you will want to read up on .htaccess files and redirection.

How to build HTML Documentation with Sandcastle

How to build CHM / HTML Documentation with Sandcastle? Can build HTML file from XML or have to used .cs and dll files?
How to build CHM / HTML Documentation with Sandcastle?
Use the Sandcastle Help File Builder.
Can build HTML file from XML or have to used .cs and dll files?
I think it uses the *.dll and the *.xml (both together) as input. One of the 'tips' in the SHFB documentation says,
"When selecting either an assembly or an XML comments file, the help file builder will automatically add the partner file for you (i.e. the XML comments file for the like-named assembly or the assembly for the like-named comments file). Multiple files can also be selected and added in one go or dragged from Windows Explorer and dropped on the Documentation Sources node."
Sandcastle uses dll to generate documentation. It also needs the xml from code comments to be build by visual studio. To do that, basically select output XML from your project build properties and then open the csproj (your VS project) in SandCastle Help file builder.