AngularJS HTML5 Mode – How do direct links work without server specific changes?

The AngularJS documentation does in fact mention this Server side Using this mode requires URL rewriting on server side, basically you have to rewrite all your links to entry point of your application (e.g. index.html) In this case, one Java-based solution is to tell the server “map all urls to index.html.” This can be done … Read more

How to replace a value in web.xml with a Maven property?

Add to your pom section: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <webResources> <resource> <filtering>true</filtering> <directory>src/main/webapp</directory> <includes> <include>**/web.xml</include> </includes> </resource> </webResources> <warSourceDirectory>src/main/webapp</warSourceDirectory> <webXml>src/main/webapp/WEB-INF/web.xml</webXml> </configuration> </plugin> See Maven: Customize web.xml of web-app project for more details

cvc-complex-type.2.4.a: Invalid content was found starting with element ‘init-param’

The order of elements in web.xml matters and in all examples I’ve come across, the <load-on-startup> comes after <init-param>. <servlet> <servlet-name>spring1</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>

SEVERE: ContainerBase.addChild: start:org.apache.catalina.LifecycleException: Failed to start error

Got the solution for this problem…. Wooo Make sure that Appliction server (Tomcat etc.) uses the same java runtime version as per what your java application is using. Make sure that your using jre path not jdk path for the runtime enviroments Make sure when creating a project select the appropriate server runtime versions.

What is the significance of url-pattern in web.xml and how to configure servlet?

url-pattern is used in web.xml to map your servlet to specific URL. Please see below xml code, similar code you may find in your web.xml configuration file. <servlet> <servlet-name>AddPhotoServlet</servlet-name> //servlet name <servlet-class>upload.AddPhotoServlet</servlet-class> //servlet class </servlet> <servlet-mapping> <servlet-name>AddPhotoServlet</servlet-name> //servlet name <url-pattern>/AddPhotoServlet</url-pattern> //how it should appear </servlet-mapping> If you change url-pattern of AddPhotoServlet from /AddPhotoServlet to /MyUrl. … Read more

Maven: Customize web.xml of web-app project

is there a way to have two web.xml files and select the appropriate one depending on the profile? Yes, within each profile you can add a configuration of the maven-war-plugin and configure each to point at a different web.xml. <profiles> <profile> <id>profile1</id> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <webXml>/path/to/webXml1</webXml> </configuration> </plugin> … As an alternative … Read more

Sometimes I see JSF URL is *.jsf, sometimes *.xhtml and sometimes /faces/*. Why?

The .jsf extension is where the FacesServlet is during the JSF 1.2 period often mapped on in the web.xml. <servlet-mapping> <servlet-name>facesServlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping> The .xhtml extension is of the actual Facelets file as you’ve physically placed in the webcontent of your webapp, e.g. Webapp/WebContent/page.xhtml. If you invoke this page with the .jsf extension, e.g. http://localhost:8080/webapp/page.jsf … Read more

How to exclude one url from authorization

Omit the <auth-constraint> element in <security-constraint> for resources for which you don’t need authentication like: <security-constraint> <web-resource-collection> <web-resource-name>app</web-resource-name> <url-pattern>/info</url-pattern> </web-resource-collection> <!– OMIT auth-constraint –> </security-constraint> <security-constraint> <web-resource-collection> <web-resource-name>app</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>Role</role-name> </auth-constraint> </security-constraint>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)