How can i Connect struts-config.1-3.10.dtd file my struts-config.xml - struts-config

I am a beginner to struts.I am getting a error i never heard in classroom.The error is in struts-config.xml.The code for it is
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd">
<struts-config><form-beans>
<form-bean name="form1" type="LoginForm"/>
</form-beans><action-mappings>
<action path="/LoginAction" name="form1" type="LoginAction"/>
<forward name="success" path="/success.jsp"/>
<forward name="failuer" path="/Failure.jsp"/
</action>
</action-mappings>
</struts-config>
Now the problem at <!DOCTYPE> tag and di
splaying the following error
"The download of the specified resource has failed. Error processing resource
'http://struts.apache.org/dtds/struts-config_1...
"http://struts.apache.org/dtds/struts-config_1_3.dtd">"
While trying to fix this error i download the .dtd file from http://struts.apache.org/1.x/struts-core/dtddoc/struts-config_1_3.dtd.org.html
and saved it.In struts-config.xml, i tried to locate place where i save downloaded file
but is not working.
What should i do to fix this problem.Where i went wrong.Any response will be appriciated.

Put the downloaded "struts-config_1_3.dtd" file in WEB-INF folder.
Also from struts-config.xml in DOCTYPE tag replace the following
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd">
with
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "struts-config_1_3.dtd">

Related

Can not find "locale.properties" file from PDF.js

I use this plugin: PDF.js.
I am trying to solve the problems that show in console log.
Follow image:
Here is a simple project ready, only download and run project you will see the same problem. I've tried everything and I can not solve a problem.
Follow html:
<div style="width: 800px; height: 500px;">
<iframe width="800" height="500" id="iframePdfViewer" seamless="seamless" scrolling="no" src="~/Scripts/pdfjs-dist/web/viewer.html"></iframe>
</div>
See another image that contains "locale.properties" file:
And I also get a lot of warnings from l10n.js. I downloaded it here: http://mozilla.github.io/pdf.js/ by clicking the "download" button.
Any solution ?
Adding .properties MIME type configuration inside web.config file should work:
<configuration>
<!-- other stuff -->
<system.webServer>
<staticContent>
<mimeMap fileExtension=".properties" mimeType="application/octet-stream" />
</staticContent>
</system.webServer>
</configuration>
If the project is already deployed in IIS (not IIS Express), go to site name => MIME Types => Add, and set .properties extension with application/octet-stream type as in provided image below:
Here is the console log view with all l10n.js errors disappear:
The reason behind usage of application/octet-stream is that the corresponding file should be treated as stream, even file contents are readable and stored in text format.
Reference: l10n.js - locale.properties 404 (Not Found)
If you are using .net core (2.1) try to add .properties as static file in your "public void Configure(IApplicationBuilder app, IHostingEnvironment env)" method
var provider = new FileExtensionContentTypeProvider();
provider.Mappings[".properties"] = "application/octet-stream";
app.UseSpaStaticFiles(new StaticFileOptions
{
ContentTypeProvider = provider
});
Inspired by Lukáš Janeček, If you are using .net core(3.1). try to add the following code to your public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
var provider = new FileExtensionContentTypeProvider();
provider.Mappings[".properties"] = "application/octet-stream";
app.UseStaticFiles(new StaticFileOptions()
{
ContentTypeProvider = provider
});

Accessing "test.html" page from the browser at the following url http://mysharepointservername.com/test.html

Which directory should I use to place test.html to access it via the browser by using the following url:
http://mysharepointservername.com/test.html ?
If I place the file to C:\inetpub\wwwroot\wss\VirtualDirectories\80 , I get 404 not found error.
Is there another directory I should use to place test.html?
Thank you in advance
You can create a module in sharepoint and place test.html under that module.
And in elements.xml write:
Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="CustomPage" Url="">
<File Url="CustomPage\test.html" Name="test.html" Type="Ghostable" />
</Module>
</Elements>
And deploy this module using feature.
In this way you can access the page with http://mysharepointservername.com/test.html

ServiceStack Razor ContentPage Works in Debug but not deployed

I am trying a very simple contentpage at ~/View.cshtml that consists of
#inherits ViewPage
 #{
Layout = "SimpleLayout";
ViewBag.Title = "Title";
}
<div id="content-page">
<p>Test</p>
</div>
at ~/Views/Shared/SimpleLayout.cshtml is
<!DOCTYPE HTML>
<html>
<head>
<title>Simple Layout</title>
</head>
<body>
<div id="content">
#RenderBody()
</div>
</body>
</html>
In debug mode it works fine, but on deploy it then shows
Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.
Compiler Error Message: CS0146: Circular base class dependency
involving 'RazorOutput.ViewPage' and 'RazorOutput.ViewPage'
I'm trying to follow the RockStars example as closely as possible, so don't have an idea of what's wrong. My service views work fine.
Any suggestions would be appreciated.
Update
When the name of the page is changed (e.g. NewPage.cshtml) then it will not work in Debug either, throwing the same exception.
In Web.Config, make sure that you have:
<compilation debug="false">
I was getting the same error, and this fixed it.
Setting compilation debug="false" as suggested above did not work for me.
I was having the same error running locally in IIS Express and found that if I added this to the web.config it would work:
<appSettings>
<add key="webPages:Enabled" value="false" />
</appSettings>
I found that setting in ServiceStack's RazorRockstar sample, after comparing it line by line with my own project to see why mine wasn't working.
I was receiving similar compilation errors when trying to render Razor pages. Check that your website's AppHost is inheriting from AppHostBase and not AppHostHttpListenerBase.

FileZilla is saying there is an error in the W3.org link!

I just got my free web hosting set up (trigoblocks.comuf.com), I connected via FileZilla FTP and uploaded my files. The error I get is "Parse error: syntax error, unexpected T_STRING in /home/a3639879/public_html/header.php on line 1".
Header.php line 1-2:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
I do not get this error while on localhost with XAMPP.
Your issue is that the <? in <?xml is a PHP short tag.
Change the first line to:
<?php print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; ?>
to fix this, or disable PHP's short tags.

JSTL tag not translate in HTML

My imports :
xmlns:c="http://java.sun.com/jstl/core"
xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
My JSTL Code :
<h:outputLabel value="YESS" >
<fmt:formatNumber value="0.25" type="percent"></fmt:formatNumber>
HTML generated code:
<label>YESS</label>
<fmt:formatNumber value="0.25" type="percent"></fmt:formatNumber>
The generated code show that the JSTL core is translate in HTML.
But the JSTL "fmt" is not translate in HTML.
More information:
<fmt:ErrorInThisFunctionName value="0.25" type="percent" /> ===> generate an error
I work on Tomcat 6
What Pierre said, and also,
Try xmlns:fmt="http://java.sun.com/jstl/fmt"
Check web.xml for
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
suggestion:
check your TLD file.
check your header (DTD, attributes) in your web.xml
If you are using the normal JSP syntax and not the XML-based syntax try using
<%# taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
xmlns:c="http://java.sun.com/jstl/core"
xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
The URI for core taglib is invalid. It should be http://java.sun.com/jsp/jstl/core as per its TLD, with /jsp. The URI for format taglib is perfectly fine as per its TLD.
Does the core taglib work in any way? If it doesn't work as well, then it simply means that JSTL is not installed at all. Tomcat does not ship with JSTL by default. You need to download jstl-1.2.jar and put it in /WEB-INF/lib of your webapp. That's all. Do not extract the JAR file and put its loose contents (TLD files and so on) in the classpath as some poor tutorials suggests. It will only get worse. If you already did so, you should cleanup. Only putting the JSTL JAR in classpath is enough.
I had the exact same problem where I would basically declare and it wouldn't get translated into HTML (basically, instead of printing the variable, the entire c:out was printed in the html source). I had forgotten to add this dependency to maven:
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
(If the xml doesn't print, the groupId is taglibs, the artifactId is standard, and the version is 1.1.2