I'm building a small cross-platform app using PhoneGap. When I inspected the splash screen configuration, I found these attributes in config.xml:
<gap:splash src="res/screen/android/screen-ldpi-portrait.png" gap:platform="android" gap:density="ldpi" />
<gap:splash src="res/screen/android/screen-mdpi-portrait.png" gap:platform="android" gap:density="mdpi" />
<gap:splash src="res/screen/android/screen-hdpi-portrait.png" gap:platform="android" gap:density="hdpi" />
<gap:splash src="res/screen/android/screen-xhdpi-portrait.png" gap:platform="android" gap:density="xhdpi" />
<gap:splash src="res/screen/blackberry/screen-225.png" gap:platform="blackberry" />
<gap:splash src="res/screen/ios/screen-iphone-portrait.png" gap:platform="ios" width="320" height="480" />
<gap:splash src="res/screen/ios/screen-iphone-portrait-2x.png" gap:platform="ios" width="640" height="960" />
<gap:splash src="res/screen/ios/screen-ipad-portrait.png" gap:platform="ios" width="768" height="1024" />
<gap:splash src="res/screen/ios/screen-ipad-landscape.png" gap:platform="ios" width="1024" height="768" />
<gap:splash src="res/screen/windows-phone/screen-portrait.jpg" gap:platform="winphone" />
It seems that the only splash screen allowed is a static image. I would like to use a dynamic splash screen which shows a spinner, makes a few network calls, and passes on to the main page when the calls return.
Any idea how to do this? I can disable the splash altogether and add this functionality to my inner web page, but it isn' elegant IMO.
Related
My application can have below URLs:
/siteadmin/homepage/
/siteusers/customer/createCustomer
Below is my spring-security.xml:
<beans:beans>
<http auto-config="true">
<intercept-url pattern="/siteusers***" access="isAuthenticated()" />
<!-- <intercept-url pattern="siteusers/home/*" access="hasRole('USER') OR hasRole('ADMIN')" /> -->
<intercept-url pattern="/siteadmin***" access="hasRole('ROLE_ADMIN')" />`enter code here`
<form-login login-page="/siteusers/loginprocess/login" default-target-url="/siteusers/home/homepage"
login-processing-url="/siteusers/loginprocess/login"
authentication-failure-url="/siteusers/loginprocess/login?error" username-parameter="username"
password-parameter="password" />
<logout logout-success-url="/siteusers/loginprocess/login?logout" logout-url="/siteusers/loginprocess/logout" />
<!-- enable csrf protection -->
<csrf />
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="b" password="123456" authorities="ROLE_ADMIN" />
<user name="a" password="a" authorities="ROLE_USER" /><!-- This user can not access /admin url -->
</user-service>
</authentication-provider>
</authentication-manager>
</beans:beans>
If I logged in with user 'a' and hit URL http://localhost:8080/siteadmin/homepage/ it is allowing user 'a' to view the page although his role is not admin. But when I try to hit http://localhost:8080/siteadmin then Spring Security is working fine ie. its showing access denied page.
I want to restrict /admin/* URLs for users who doesn't have Admin role.
See AntPathMatcher:
The mapping matches URLs using the following rules:
? matches one character
* matches zero or more characters
** matches zero or more directories in a path
Some examples:
com/t?st.jsp - matches com/test.jsp but also com/tast.jsp or com/txst.jsp
com/*.jsp - matches all .jsp files in the com directory
com/**/test.jsp - matches all test.jsp files underneath the com path
org/springframework/**/*.jsp - matches all .jsp files underneath the org/springframework path
org/**/servlet/bla.jsp - matches org/springframework/servlet/bla.jsp but also org/springframework/testing/servlet/bla.jsp and org/servlet/bla.jsp
Your pattern /siteadmin***misses slashes. Use /siteadmin/**.
I have a website that has a video background on it's homepage. The video get's fetched from the folder 'videowall'. The live version of the site doesn't play the video and I get 'Failed to load resource: the server responded with a status of 404 (Not Found)' in the developer tools window. I checked the root folder of the FTP server and the folder was there.
The portion of the code that plays the video :
<video preload="auto" autoplay="autoplay" loop="loop" volume="0" poster="~/video/oranges.jpg" muted="muted">
<source src="/videowall/pete.mp4" type="video/mp4" />
<%--<source src="~/video/oranges.webm" type="video/webm" />--%>
<source src="/videowall/pete.ogv" type="video/ogg" />
</video>
The path of the file is relative to the root directory. Why is the FTP server not able to find it?
you need to add a custom mime type in the web.config to serve the mp4 file.
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
</staticContent>
</system.webServer>
</configuration>
You can reference the following links:
https://social.msdn.microsoft.com/Forums/azure/en-US/79eb0c22-fe78-41d6-ac57-03055610b2a8/mp4-media-files-on-azure-website?forum=windowsazurewebsitespreview&prof=required
http://www.iis.net/configreference/system.webserver/staticcontent/mimemap
I have configured spring authentication as below and its not working as expected
<sec:http auto-config="true">
<!-- Restrict URLs based on role -->
<sec:intercept-url pattern="pages/login.jsp" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<sec:intercept-url pattern="/css/style.css" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<sec:intercept-url pattern="pages/**" access="ROLE_USER" />
<!-- Override default login and logout pages -->
<sec:form-login login-page="/login.jsp"
default-target-url="/pages/products.xhtml"
authentication-failure-url="/login.html?login_error=1" />
<sec:logout logout-url="/logout" logout-success-url="/login.jsp" />
</sec:http>
On server start up i have been redirected to login.jsp ,if i use login form i am redirected to products.xhtml so far fine but if i directly access products.xhtml , it just allowing me to access the product.xhtml(Even after closing the broser or even on server restart) instead of redirecting to login.jsp . Could anyone just me what i am missing exactly?
Thanks & Regards
Vijay
Your patterns and URLs aren't consistent. You have "/login.jsp" for the login page and "pages/login.jsp" in the intercept-url pattern.
Try using:
<http pattern="/css/**" security="none">
<http>
<intercept-url pattern="/login.jsp" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<intercept-url pattern="/**" access="ROLE_USER" />
<form-login login-page="/login.jsp"
default-target-url="/pages/products.xhtml"
authentication-failure-url="/login.html?login_error=1" />
<logout logout-url="/logout" logout-success-url="/login.jsp" />
</http>
The debug log for a particular request will explain exactly why it is or isn't secured.
Make sure you do not have a Cookie or a valid session...
I'm getting this error when I try to use access an ASP.NET MVC3 application using the Spark View Engine published to my local IIS 7 server. I've looked at this answer and have already followed that advice, but I still get problems. I also tried changing the Copy Local setting to true for the Microsoft.Web.Mvc DLL. I never get this error with the Visual Studio debug server. Republishing sometimes makes the error go away, but it comes back.
Where should I start looking to get rid of this problem?
Thanks!
<!-- At the end of my Web.config: -->
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
edit: For clarity, the IIS server that I'm trying to deploy to is on my development machine.
edit: My _global.spark looks something like this:
<use namespace="System.Collections.Generic"/>
<use namespace="System.Web.Mvc.Html"/>
<use namespace="System.Web.Mvc"/>
<use namespace="System" />
<use namespace="System.Linq" />
<use namespace="Namespace.For.Some.Code" />
<use namespace="Namespace.For.Some.More.Code" />
<use namespace="Namespace.For.Yet.Some.More.Code" />
<use namespace="Microsoft.Web.Mvc" />
<use namespace="Namespace.For.Still.More.Code" />
<!-- Added after suggested answer -->
<use assembly="Microsoft.Web.Mvc"/>
<global type="string" Title="'title of my app'" />
<global type="SomeDomainObject" SomeVariable="Utilities.ApplicationUtilities.GetSomeDomainObject" />
Have you referenced MVC from your /Shared/_global.spark file?
You can see the details in this answer
Alternatively you can add the namespaces to your SparkSettings when you register the ViewEngine. This is what mine looks like:
var settings = new SparkSettings()
.SetDebug(true)
.SetAutomaticEncoding(true)
.AddAssembly("Web")
.AddNamespace("Web.Model")
.AddNamespace("System.Collections.Generic")
.AddNamespace("System.Linq")
.AddNamespace("System.Web.Mvc")
.AddNamespace("System.Web.Mvc.Html");
Hope that helps,
Rob
I have a asp:Menu bound to a Sitemap on my sites master page:
<asp:Menu ID="Menu1" runat="server"
DataSourceID="SiteMapDataSource2"
Orientation="Horizontal"
StaticDisplayLevels="2"
CssSelectorClass="PrettyMenu">
</asp:Menu>
The menu works really well on my development box with Firefox 3.5. When I try to run the site within IE7 the menu does not respond at all.
Is there something related to the menu code that would cause this?
UPDATE2:
The issue appears to be related to the CSS Friendly Controls Adaptor. Firefox is responsive but IE7 only shows the top tier of the menu and doesn't respond at all.
I had a similar problem with IIS 6.0 and IE8. The following Microsoft KB article talks about it. Don't know it applies in your case though:
http://support.microsoft.com/?scid=kb%3Ben-us%3B969612&x=5&y=10
In case anyone else encounters something similar:
I had to remove the CSS Friendly (browser) files from the project and all the menu issues went away.
I had similar problem, editing CSSFriendlyAdapters.Browser (located in App_Browsers folder )solved my problem. It was like this, you should remove some elements:
<browsers>
<browser refID="Default">
<controlAdapters>
<adapter controlType="System.Web.UI.WebControls.Menu"
adapterType="CSSFriendly.MenuAdapter" />
</controlAdapters>
</browser>
<browser id="W3C_Validator" parentID="default">
<identification>
<userAgent match="^W3C_Validator" />
</identification>
<capabilities>
<capability name="browser" value="W3C Validator" />
<capability name="ecmaScriptVersion" value="1.2" />
<capability name="javascript" value="true" />
<capability name="supportsCss" value="true" />
<capability name="supportsCallback" value="true" />
<capability name="tables" value="true" />
<capability name="tagWriter" value="System.Web.UI.HtmlTextWriter" />
<capability name="w3cdomversion" value="1.0" />
</capabilities>
</browser>
</browsers>