Tech News is a blog created by Wasim Akhtar to deliver Technical news with the latest and greatest in the world of technology. We provide content in the form of articles, videos, and product reviews.
Immunet Protect Free 3.1.8.9552
via FileHippo.com http://filehippo.com/download_immunet_protect_free/ [[ We are also giving web service. Email:wasim.akh2@gmail.com]]
DivX Play 10.1.0
via FileHippo.com http://filehippo.com/download_divx_play/ [[ We are also giving web service. Email:wasim.akh2@gmail.com]]
Auslogics Disk Defrag 4.4.2.0
via FileHippo.com http://filehippo.com/download_auslogics_disk_defrag/ [[ We are also giving web service. Email:wasim.akh2@gmail.com]]
Foobar2000 1.3
via FileHippo.com http://filehippo.com/download_foobar2000/ [[ We are also giving web service. Email:wasim.akh2@gmail.com]]
Android in-car initiative with Audi, Nvidia tipped for CES
via PCWorld http://www.techhive.com/article/2083341/android-in-car-initiative-with-audi-nvidia-tipped-for-ces.html#tk.rss_all
McAfee Labs Stinger 12.1.0.725
via FileHippo.com http://filehippo.com/download_mcafeelabsstinger/56649/ [[ We are also giving web service. Email:wasim.akh2@gmail.com]]
iPhones Coming To China Mobile From January 17th
It has been announced that Apple and China Mobile have struck a deal, allowing the iPhone 5s and 5c to be launched on the China Mobile’s 4G and 3G networks in the early part of 2014.
Apparently you can pre-register for one of the phones now, with the handsets becoming available from January 17th.
In the press release, Apple CEO Tim Cook said: “China is an extremely important market for Apple and our partnership with China Mobile presents us the opportunity to bring iPhone to the customers of the world’s largest network.”
It has taken time for Apple to gain access to China Mobile’s alleged 760 million customers, with talks between the two companies going on since 2011. It was The Wall Street Journal that reported earlier this month that a deal had finally been reached and finalised.
A recent report from Canalys stated that China, Hong Kong and Taiwan account for 39 percent of the global smartphone market between them. Apple ranked fifth in the region’s smartphone sales but now a deal has been struck, it has been predicted that it could lead to a possible 30 million more iPhones being sold.
The announcement of the deal also said that it will “give a big boost to the development of China’s homegrown 4G/TD-LTE technology.” Pricing details will be revealed at a later date.
[Image via Business Insider]
SOURCE: http://techcrunch.com/2013/12/22/apple-china-mobile/
The post iPhones Coming To China Mobile From January 17th appeared first on TechBeat.
via TechBeat http://techbeat.com/2013/12/iphones-coming-china-mobile-january-17th/?utm_source=rss&utm_medium=rss&utm_campaign=iphones-coming-china-mobile-january-17th
Sony Giving PlayStation Plus 3 Games From 2013 For Free!
To get 2014 off to a good start, Sony has announced it will be giving some of 2013′s best games to PlayStation Plus subscibers.
Some of the top titles that have been selected for PS3, which will be added to the PlayStation Plus Instant Game Collection are: Bioshock Infinite, DmC: Devil May Cry and Brothers: A Tale of Two Sons.
As for the PlayStation 4 owners, they will receive Don’t Starve for free and if you have a PS Vita, then you will be able to download Worms: Battle Island and the trivia game Smart As.
In order to download and play these games, you will have to have an active PlayStation Plus membership. If your renewal lapses then they will become unplayable.
Although a PlayStation Plus subscription costs $49.99 a year, games will be added regularly to the rotating Instant Game Collection throughout this next year. And don’t forget that you can often find the 12-month voucher at a discount price, so it’s definitely worth considering.
[Image via pacmen]
The post Sony Giving PlayStation Plus 3 Games From 2013 For Free! appeared first on TechBeat.
via TechBeat http://techbeat.com/2013/12/sony-giving-playstation-plus-3-games-2013-free/?utm_source=rss&utm_medium=rss&utm_campaign=sony-giving-playstation-plus-3-games-2013-free
There's no Here there: Nokia pulls map app off iOS
via PCWorld http://www.techhive.com/article/2083256/theres-no-here-there-nokia-pulls-map-app-off-ios.html#tk.rss_all
The Internet Archive rekindles early video game consoles with emulation
via PCWorld http://www.techhive.com/article/2082318/the-internet-archive-rekindles-early-video-game-consoles-with-emulation.html#tk.rss_all
Spring @RequestHeader Annotation example
Let us quickly check how to access http Header information in Spring MVC Controller.
Spring @RequestHeader Annotation
Spring MVC provides annotation @RequestHeader that can be used to map controller parameter to request header value. Following is the simple usage of spring @RequestHeader annotation.
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
//..
@Controller
public class HelloController {
@RequestMapping(value = "/hello.htm")
public String hello(@RequestHeader(value="User-Agent") String userAgent)
//..
}
}
In above code snippet we defined a controller method hello()
which is mapped to URL /hello.htm. Also we bind the parameter String userAgent
using @RequestHeader
annotation. When spring maps the request, it checks http header with name “User-Agent” and bind its value to String userAgent.
If the header value that you specified does not exists in request, Spring will initialize the parameter with null value. In case you want to set default value of parameter you can do so using defaultParameter
attribute of spring @RequestHeader
annotation.
@RequestMapping(value = "/hello.htm")
public String hello(@RequestHeader(value="User-Agent", defaultValue="foo") String userAgent)
//..
}
Complete Tutorial
Now we know the concept, let us use it and create a Spring MVC application to print value of different http request headers. Following is demo application for Spring Requestheader example.
For this tutorial I will be using following tools and technologies:
- Spring MVC 3.2.6.RELEASE
- Java 6
- Eclipse
- Maven 3
Following is the project structure.
Create and copy following file contents in the project structure.
Maven configuration: pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.viralpatel.spring</groupId>
<artifactId>Spring_Cookie_example</artifactId>
<packaging>war</packaging>
<version>1.0.0-SNAPSHOT</version>
<name>SpringMVCCookie</name>
<properties>
<org.springframework.version>3.2.6.RELEASE</org.springframework.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<compileSource>1.6</compileSource>
</properties>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<!-- Spring MVC -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<!-- JSTL taglib -->
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
</dependency>
</dependencies>
<build>
<finalName>springcookie</finalName>
</build>
<profiles>
</profiles>
</project>
Maven configuration is simple. We just need Spring MVC and JSTL dependency.
Deployment description: web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Spring MVC Http Cookie</display-name>
<welcome-file-list>
<welcome-file>hello.htm</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
</web-app>
Web.xml is quite simple too. We just need to configure Spring’s DispatcherServlet
with *.htm url pattern.
Spring Configuration: spring-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<context:annotation-config />
<context:component-scan base-package="net.viralpatel.spring" />
</beans>
In spring-servlet.xml we just defined component scan to load @Controller
classes. Note that we are not defining view resolver as we dont need that for this exmaple. But ideally you’ll have one view resolver that maps to JSP views.
Spring Controller: HelloController.java
package net.viralpatel.spring;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HelloController {
@RequestMapping(value = "/hello.htm")
public String hello(
@RequestHeader(value="Accept") String accept,
@RequestHeader(value="Accept-Language") String acceptLanguage,
@RequestHeader(value="User-Agent", defaultValue="foo") String userAgent,
HttpServletResponse response) {
System.out.println("accept: " + accept);
System.out.println("acceptLanguage: " + acceptLanguage);
System.out.println("userAgent: " + userAgent);
return null;
}
}
The logic to read http requestheader is written in HelloController. We used spring @RequestHeader annotation to map userAgent, accept, acceptLanguage strings from request header.
Demo
Open your favorite web browser and point to below URL:
http://localhost:8080/Spring_RequestHeader_example/hello.htm
The page will be blank because we haven’t rendered any JSP view. Check the server Console logs. You’ll see the http header values.
Download Source Code
Spring_RequestHeader_example.zip (8 KB)
References
The post Spring @RequestHeader Annotation example appeared first on ViralPatel.net.
Related Posts
- Spring MVC Exception Handling using @ControllerAdvice annotation
- Spring MVC Cookie example
- Spring 3 MVC Interceptor tutorial with example
- Spring MVC Flash Attribute tutorial with example
- Spring 3 MVC: Create Hello World application in Spring 3.0 MVC
- Spring MVC Multiple File Upload example
- Spring MVC HashMap Form Integration example
via ViralPatel.net http://feedproxy.google.com/~r/viralpatelnet/~3/vesOgxkVRgA/
Picasa 3.9 Build 137.76
via FileHippo.com http://filehippo.com/download_picasa/ [[ We are also giving web service. Email:wasim.akh2@gmail.com]]
Download Windows 11 Insider Preview Build Offline ISO Files
UPDATE: Offline ISO files are available for Windows 11 Insider Preview build 27774 (Canary Channel), 26100.1150 (Dev Channel), 22621 (Beta C...
-
Newer versions of Windows 11 come with a new security feature called “Windows Protected Print Mode (WPP)“. This article will help you in act...
-
UPDATE: Direct download links added for the latest Mozilla Firefox 131.0.2, 115.16.1 ESR and 128.3.1 ESR offline installers. NOTE: The downl...