JSF 2.2 upload image resource not available - java-8

I have written a very simple xhtml code which calls the java bean in JSF
Following is the code;
index.xhtml
<!DOCTYPE html>
<html lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<style>
.centered{
position: absolute;
width: 50%;
height: auto;
top:15%;
left:40%;
right:25%;
bottom:auto;
}
.overlay:hover {
opacity: 0.9;
}
.overlay{
position: absolute;
top: 0;
bottom: 20%;
left: auto;
right: auto;
height: 100%;
width: 36%;
opacity: 0;
transition: .5s ease;
background-color: #008CBA;
}
.text {
color: white;
font-size: 18px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
}
.top{
position:absolute;
top:0%;
left:0%;
}
</style>
<h:head>
<title>LMW</title>
<!-- <h:outputStylesheet library="css" name="..\resources\image.css" /> -->
</h:head>
<h:body>
<h:form enctype="multipart/form-data">
<div class="top">
<img src="..\resources\images\topBackground.jpg" style="width: 10000px; height: 60px;"/>
</div>
<div class="top">
<img src="..\resources\images\Logo.jpg" style="width: 42px; height: 42px;"/>
</div>
<div class="centered">
<img src="..\resources\images\Urban.jpg" style="width: 300px; height: 228px;" />
<div class="overlay">
<div class="text">Prasad Iyer Computer Science Major</div>
</div>
</div>
<br></br>
<h:inputFile value="#{uploadImage.image}"/>
<h:commandButton value="Upload" action="#{uploadImage.doUpload()}">
<!--
<f:ajax execute="#form" render="#form"/> -->
</h:commandButton>
</h:form>
</h:body>
</html>
Following is the bean code
UploadImage.java
package com.lmw.homepage;
import javax.faces.bean.ManagedBean;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.servlet.http.Part;
import javax.faces.bean.SessionScoped;
#ManagedBean
public class UploadImage {
private Part image;
public void doUpload()
{
try {
InputStream in = image.getInputStream();
File f = new File("../../../WebContent/resources/images/"+image.getName());
f.createNewFile();
//File f1 = new File("../../../WebContent/resources/images/Urban.jpg");
//f.renameTo(f1);
FileOutputStream out = new FileOutputStream(f);
byte[] buffer = new byte [1024];
int length;
while((length=in.read(buffer))>0){
out.write(buffer, 0, length);
}
out.close();
in.close();
} catch (IOException e) {
System.out.println("Your upload did not work");
}
}
public Part getImage() {
return image;
}
public void setImage(Part image) {
this.image = image;
}
}
In this code I am trying to upload an image using the JSF 2.2 tag but the problem is that when I run the code on my tomcat 8.0.45 I get the following logs
Aug 10, 2017 12:56:59 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:LinkedInmyWay' did not find a matching property.
Aug 10, 2017 12:56:59 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/8.0.45
Aug 10, 2017 12:56:59 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jun 26 2017 20:06:07 UTC
Aug 10, 2017 12:56:59 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 8.0.45.0
Aug 10, 2017 12:56:59 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 7
Aug 10, 2017 12:56:59 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.1
Aug 10, 2017 12:56:59 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Aug 10, 2017 12:56:59 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jre1.8.0_131
Aug 10, 2017 12:56:59 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_131-b11
Aug 10, 2017 12:56:59 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Aug 10, 2017 12:56:59 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\Users\priyer\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Aug 10, 2017 12:56:59 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\Program Files\Apache Software Foundation\Tomcat 8.0
Aug 10, 2017 12:56:59 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\priyer\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Aug 10, 2017 12:56:59 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 8.0
Aug 10, 2017 12:56:59 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\Users\priyer\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
Aug 10, 2017 12:56:59 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 8.0\endorsed
Aug 10, 2017 12:56:59 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Aug 10, 2017 12:56:59 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_131\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:/Program Files/Java/jre1.8.0_131/bin/server;C:/Program Files/Java/jre1.8.0_131/bin;C:/Program Files/Java/jre1.8.0_131/lib/amd64;C:\ProgramData\Oracle\Java\javapath;%PATH%;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Enterprise Vault\EVClient\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Java\jdk1.6.0_45\bin;C:\dev\apache-maven-2.2.1\bin;C:\Users\priyer\Desktop\eclipse;;.
Aug 10, 2017 12:57:00 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Aug 10, 2017 12:57:00 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Aug 10, 2017 12:57:00 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Aug 10, 2017 12:57:00 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Aug 10, 2017 12:57:00 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2084 ms
Aug 10, 2017 12:57:00 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Aug 10, 2017 12:57:00 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.45
Aug 10, 2017 12:57:02 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Aug 10, 2017 12:57:02 PM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.2.8 ( 20140814-1418 https://svn.java.net/svn/mojarra~svn/tags/2.2.8#13507) for context '/LinkedInmyWay'
Aug 10, 2017 12:57:02 PM com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
Aug 10, 2017 12:57:03 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
Aug 10, 2017 12:57:03 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Aug 10, 2017 12:57:03 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3171 ms
In which I see no error but on the front it says
The requested resource is not available
I thought the problem is to do something with a jar missing hence I included all the jars, as in the screenshot below;
All the jars
eclipse version: Luna
JSF version: 2.2
Servlet Jar included: 3.0
Tomcat version: 8.0.45
JDK version: 8
I have tried every damn thing but with no positive results and now I feel like the problem is some small thing which am not able to figure out.
Kindly provide your support.
Regards,
Prasad Iyer

Related

Svelte - unable to preprocess SCSS server side

I am currenty trying to build a Headless CMS.
The frontend uses server side rendering.
In my server.js I want to preprocess SCSS
for all files starting from my entry file App.svelte.
Does Svelte.preprocess work on Component.render()?
Does anyone has an idea?
server.js
..
// this registers .svelte files
require('svelte/register');
const App = require('./App.svelte').default;
{html, css, head} = App.render({
pageData
});
reply.view('index', {
pageData: JSON.stringify(pageData),
STATIC_DIR,
html,
// css should output preprocessed CSS
css: css.code,
head
})
./App.svelte
..
<script>
import Navigation from "./components/Navigation.svelte"
import Page from "./components/Page.svelte"
import Header from "./components/Header.svelte"
import Main from "./components/Main.svelte"
import Footer from "./components/Footer.svelte"
import Spinner from "./components/Spinner.svelte"
export let pageData;
console.log(pageData)
</script>
<Spinner></Spinner>
<h1>Das ist ein <span>Test</span></h1>
<Header>
<Navigation data="{pageData['navigation/main']}"/>
</Header>
<Main>
<Page pageData="{pageData['page']}" />
</Main>
<Footer>
<Navigation data="{pageData['navigation/footer']}"/>
</Footer>
<style lang="scss">
h1{
color: red;
span{color: yellow}
}
</style>
getting the following error:
CompileError [ParseError]: Colon is expected
at error$1 (justpm.de/node_modules/svelte/compiler.js:15501:20)
at Parser$1.error (justpm.de/node_modules/svelte/compiler.js:15600:10)
at Object.read_style [as read] (justpm.de/node_modules/svelte/compiler.js:11864:21)
at tag (justpm.de/node_modules/svelte/compiler.js:14586:34)
at new Parser$1 (justpm.de/node_modules/svelte/compiler.js:15559:22)
at parse$3 (justpm.de/node_modules/svelte/compiler.js:15729:21)
at compile (justpm.de/node_modules/svelte/compiler.js:26607:18)
at Object.require.extensions.<computed> [as .svelte] (justpm.de/node_modules/svelte/register.js:39:28)
at Module.load (internal/modules/cjs/loader.js:983:32)
at Function.Module._load (internal/modules/cjs/loader.js:891:14) {
name: 'ParseError',
code: 'css-syntax-error',
start: { line: 32, column: 12, character: 723 },
end: { line: 32, column: 12, character: 723 },
pos: 723,

When I submit an jsf form the application show a 403 error page. Why this?

I programming an Spring boot application with JSF using Joinfaces and primefaces.
I wrote the registration form and I tested it.
When i send the form with POST method the application get me a 403 error.
How can I solve this problem?
JSF template of my signup page:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<f:view>
<h:head>
<link type="text/css" rel="stylesheet" href="/css/mystyle.css"></link>
</h:head>
<h:body>
<h2>
<h:outputText value="{msg.translate('male')}"/>
</h2>
<div class="container">
<div class="card">
<div class="card-header">
<div class="card-header-title">
<div><img width="100" height="50" src="it-it/assets/images/l1.svg"> </img></div>
<p>Crea il tuo account Firenet</p>
</div>
</div>
<div class="card-content">
<h:form >
<div class="inputs-row-container">
<span class="ui-float-label group-first-item">
<p:inputText id="firstname" value="" style="width: 100%" required="true"/>
<p:message for="firstname" />
<p:outputLabel for="#previous" value="{msg.translate('signup-form.input.firstname.label')}"/>
</span>
<span class="ui-float-label">
<p:inputText value="" style="width: 100%"/>
<p:outputLabel for="#previous" value="{msg.translate('signup-form.input.lastname.label')}"/>
</span>
</div>
<span class="ui-float-label group-item">
<p:inputText id="emailInput" value="#{registrationStepOne.email}" style="width: 100%" ></p:inputText>
<p:outputLabel for="#previous" value="{msg.translate('signup-form.input.email.label')}"/>
</span>
<h:message for="emailInput" style="color: red"/>
<div class="inputs-row-container">
<span class="ui-float-label group-first-item">
<p:inputText value="" style="width: 100%" required="true"/>
<p:outputLabel for="#previous" value="{msg.translate('signup-form.input.password.label')}"/>
</span>
<span class="ui-float-label">
<p:inputText value="" style="width: 100%"/>
<p:outputLabel for="#previous" value="{msg.translate('signup-form.input.repeatpassword.label')}"/>
</span>
</div>
<p:commandButton action="/registration/secondstep.xhtml" value="Register" />
</h:form>
</div>
</div>
</div>
</h:body>
</f:view>
</html>
Java code for my JSF page:
import org.apache.commons.validator.routines.EmailValidator;
import org.ocpsoft.rewrite.annotation.Join;
import org.ocpsoft.rewrite.el.ELBeanName;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.ValidatorException;
import java.io.Serializable;
#Scope("session")
#Component(value = "registrationStepOne")
#ELBeanName(value="registrationStepOne")
#Join(path = "/signup/v1/webcreateaccount", to = "/registration/firststep.xhtml")
public class RegistrationStepOne implements Serializable {
private String email;
public RegistrationStepOne() {
// FacesContext.getCurrentInstance().getViewRoot().setLocale(new Locale("it", "IT"));
}
public String save() {
return "/registration/secondstep.xhtml";
}
// Validate Email
public void validateEmail(FacesContext context, UIComponent toValidate, Object value) throws ValidatorException {
String emailStr = (String) value;
if (!EmailValidator.getInstance(false).isValid(emailStr)) {
FacesMessage message = new FacesMessage(new ResourceBundleBean().translate("signup-form.input.email.errors.email"));
throw new ValidatorException(message);
}
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
Spring boot post request logs
: Current WebApplicationContext is not available for processing of AnnotationConfigurationProvider: Make sure this class gets constructed in a Spring web application. Proceeding without injection.
2019-09-07 11:25:40.618 DEBUG 20204 --- [0.1-8083-exec-7] o.s.w.c.s.SpringBeanAutowiringSupport : Current WebApplicationContext is not available for processing of ClassLoaderConfigurationProvider: Make sure this class gets constructed in a Spring web application. Proceeding without injection.
2019-09-07 11:25:40.618 DEBUG 20204 --- [0.1-8083-exec-7] o.s.w.c.s.SpringBeanAutowiringSupport : Current WebApplicationContext is not available for processing of ContextSpecifiedConfigurationProvider: Make sure this class gets constructed in a Spring web application. Proceeding without injection.
2019-09-07 11:25:40.619 DEBUG 20204 --- [0.1-8083-exec-7] o.s.w.c.s.SpringBeanAutowiringSupport : Current WebApplicationContext is not available for processing of DefaultXMLConfigurationProvider: Make sure this class gets constructed in a Spring web application. Proceeding without injection.
2019-09-07 11:25:40.622 DEBUG 20204 --- [0.1-8083-exec-7] o.s.w.c.s.SpringBeanAutowiringSupport : Current WebApplicationContext is not available for processing of SpringBootBeanNameResolver: Make sure this class gets constructed in a Spring web application. Proceeding without injection.
2019-09-07 11:25:40.623 DEBUG 20204 --- [0.1-8083-exec-7] o.s.w.c.s.SpringBeanAutowiringSupport : Current WebApplicationContext is not available for processing of DefaultBeanNameResolver: Make sure this class gets constructed in a Spring web application. Proceeding without injection.
2019-09-07 11:25:40.624 DEBUG 20204 --- [0.1-8083-exec-7] o.s.w.c.s.SpringBeanAutowiringSupport : Current WebApplicationContext is not available for processing of FacesBeanNameResolver: Make sure this class gets constructed in a Spring web application. Proceeding without injection.
2019-09-07 11:25:40.624 DEBUG 20204 --- [0.1-8083-exec-7] o.s.w.c.s.SpringBeanAutowiringSupport : Current WebApplicationContext is not available for processing of SpringBeanNameResolver: Make sure this class gets constructed in a Spring web application. Proceeding without injection.
2019-09-07 11:25:40.635 WARN 20204 --- [0.1-8083-exec-7] unknown.jul.logger : Cannot find classes folder: /WEB-INF/classes/
2019-09-07 11:25:40.644 DEBUG 20204 --- [0.1-8083-exec-7] o.s.w.c.s.SpringBeanAutowiringSupport : Current WebApplicationContext is not available for processing of WebXmlServletRegistrationProvider: Make sure this class gets constructed in a Spring web application. Proceeding without injection.
2019-09-07 11:25:40.644 DEBUG 20204 --- [0.1-8083-exec-7] o.s.w.c.s.SpringBeanAutowiringSupport : Current WebApplicationContext is not available for processing of Servlet3ServletRegistrationProvider: Make sure this class gets constructed in a Spring web application. Proceeding without injection.
2019-09-07 11:25:40.655 DEBUG 20204 --- [0.1-8083-exec-7] o.s.w.c.s.SpringBeanAutowiringSupport : Current WebApplicationContext is not available for processing of ContextParamsPostProcessor: Make sure this class gets constructed in a Spring web application. Proceeding without injection.
2019-09-07 11:25:40.658 DEBUG 20204 --- [0.1-8083-exec-7] o.s.web.servlet.DispatcherServlet : "ERROR" dispatch for POST "/error", parameters={masked}
The error is probably due to Spring CSRF protection .
If you enable debug logging for Spring security in application.properties
(logging.level.org.springframework.security: debug)
then you will see something like
2019-12-24 15:56:33,951 [99] DEBUG o.s.security.web.csrf.CsrfFilter:doFilterInternal 127 - Invalid CSRF token found for <JSF page>
As JSF already has a built-in CSRF protection (2,3) you can disable the Spring own CSRF protection via configuration:
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
#Configuration
#EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
#Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable();
}
}
See also 4.

Xamarin.iOS App terminated error when running on device in debug mode, quits in release mod but works fine in simulator

UPDATE: the app runs fine in simulator and can be debugged.
I was able to debug the app fine 3 days ago. When i came back to work on it I receive the error below right after deploying to iOS Device. If I run in release the app just quits immediately.
I do not know where to start with this error because its not suggestive to the problem and appeared seemingly out of nowhere. I am not sure why there's an ASP.NET error, I am developing a Xamarin.Forms cross platform mobile app.
Things I have tried:
Updated Windows, Visual Studio, NuGet packages, Xcode
Deleted bin and obj folders
Cleaned & Rebuild
Erased app from device
Can anyone point me in the right direction as to what this error is about?
I am using latest Visual Studio, Xcode, and Windows 10 build 1809 as of 11 Dec 2018:
2018-12-11 14:56:45.424 MyApp.iOS[1352:236793] Token received: <c888863b cb362ba8 3028fa09 ea6171ce e88231e3 f1d5f6a3 071e47aa 1b2511e3>
Thread started: #9
Thread started: <Thread Pool> #10
2018-12-11 14:56:46.014 MyApp.iOS[1352:236793] <!DOCTYPE html>
<html>
<head>
<title>The resource cannot be found.</title>
<meta name="viewport" content="width=device-width" />
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Consolas","Lucida Console",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
#media screen and (max-width: 639px) {
pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; }
}
#media screen and (max-width: 479px) {
pre { width: 280px; }
}
</style>
</head>
<body bgcolor="white">
<span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>
<h2> <i>The resource cannot be found.</i> </h2></span>
<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
<b> Description: </b>HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
<br><br>
<b> Requested URL: </b>/push/installations/e99787d6-f94e-4ddf-888d-9b4e8e680bdd<br><br>
<hr width=100% size=1 color=silver>
<b>Version I
The app has been terminated.
llback cb, Object extraData)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.<>c__DisplayClass285_0.<ExecuteStepImpl>b__0()
at System.Web.HttpApplication.StepInvoker.Invoke(Action executionStep)
at System.Web.HttpApplication.StepInvoker.<>c__DisplayClass4_0.<Invoke>b__0()
at Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule.OnExecuteRequestStep(HttpContextBase context, Action step)
at System.Web.HttpApplication.<>c__DisplayClass284_0.<OnExecuteRequestStep>b__0(Action nextStepAction)
at System.Web.HttpApplication.StepInvoker.Invoke(Action executionStep)
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
--><!--
This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/
nformation:</b> Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3163.0
</font>
</body>
</html>
<!--
[HttpException]: The controller for path '/push/installations/e99787d6-f94e-4ddf-888d-9b4e8e680bdd' was not found or does not implement IController.
at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)
at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)
at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state)
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCa
>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->
Failed to Stop app: An error occured on client IDB412377 while executing a reply for topic xvs/idb/4.12.3.77/stop-app
The app has been terminated.

Nginx cache headers

My nginx is returning the following response:
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 29 Aug 2017 12:52:34 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
Set-Cookie: PHPSESSID=btj7eq897r10tl7br5pf97ttd4; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
I have no idea where does Expires and Cache-Control are being set, I checked the site's config on nginx and its not there...any ideas?
OK that is set by PHP so it's fine:
https://andidittrich.de/2015/09/php-worry-about-some-magical-added-cache-control-header.html

How to access/choose calender values using xpath

I want to choose/select a particular date of a month and my screen displays multiple months on the screen (for example - JAN, FEB, MAR ).
Here is my tree structure:
div class="MeCalendarMonthDay MeCalendarWeekDay3"
style="width:14.285714285714286%;height:50px">
<span>14</span>
<input type="hidden" value="Wed Aug 14 2013">
</div>
I tried the below options ( I am using selenium test automation tool )
calender = driver.findElement(By.className("MeCalendarMonthNotSingle"));
date = calender.findElement(By.xpath("//div[#class='MeCalendarMonthName' and
contains(.='Aug 2013')]"));
date.findElement(By.xpath("//input[#value = 'Tue Aug 13 2013']")).click();
Also I tried
date.findElement(By.xpath("//input[#type='hidden' and value = 'Tue Aug 13
2013']")).click();
But, none of the above options are working for me. Can you please help me ?
The below option at times works.However, it fails to recognize the month as there are
multiple months displayed on the page.
date.findElement(By.xpath("//span[text()='13']")).click();`
Here you have some XPath solutions. Don't exactly know which element you want to be returned:
Selects on #class from <div> and #value from <input>. Returns the <input> element:
calender.findElement(By.xpath("//div[contains(#class,'MeCalendarMonthDay')]/input[contains(#value, 'Aug 14')]"));
Selects on #class from <div> and #value from <input>. Returns the <div> element:
calender.findElement(By.xpath("//div[contains(#class,'MeCalendarMonthDay') and input[contains(#value, 'Aug 14')]]"));
calender.findElement(By.xpath("//div[contains(#class,'MeCalendarMonthDay')][input[contains(#value, 'Aug 14')]]"));
Selects on #class from <div> and text() from <span> and #value from <input>. Returns the <input> element:
calender.findElement(By.xpath("//div[contains(#class,'MeCalendarMonthDay') and span = 14]/input[contains(#value, 'Aug 14')]"));
calender.findElement(By.xpath("//div[contains(#class,'MeCalendarMonthDay')][span = 14]/input[contains(#value, 'Aug 14')]"));
Selects on #class from <div> and text() from <span> and #value from <input>. Returns the <div> element:
calender.findElement(By.xpath("//div[contains(#class,'MeCalendarMonthDay') and input[contains(#value, 'Aug 14')] and span = 14]"));
calender.findElement(By.xpath("//div[contains(#class,'MeCalendarMonthDay')][span=14][input[contains(#value, 'Aug 14')]]"));
If you want the <span> element to be returned:
Selects on #class from <div> and #value from <input>. Returns the <span> element:
calender.findElement(By.xpath("//div[contains(#class,'MeCalendarMonthDay')][input[contains(#value, 'Aug 14')]]/span"));
calender.findElement(By.xpath("//div[contains(#class,'MeCalendarMonthDay') and input[contains(#value, 'Aug 14')]/span"));

Resources