Search Results

Search found 15134 results on 606 pages for 'spring framework'.

Page 10/606 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Spring MVC + Hibernate encoding problem

    - by Bar
    I work on Spring MVC + Hibernate application, use MySQL (ver. 5.0.51a) with the InnoDB engine. The problem appears when I am sending a form with cyrillic characters. As the result, database contains senseless chars in unknown encoding. All the JSP pages, database (+ tables and fields) created using UTF-8. Hibernate config also contains property which sets encoding to UTF-8. I had solved this by creating filter which encodes request content with UTF-8. Exemplary code: … encoding = "UTF-8"; request.setCharacterEncoding(encoding); chain.doFilter(request, response); … But it visibly slows down the app. The interesting thing is that executing insert query directly from the app (i.e. running from Eclipse as Java Application) works perfect. Any suggestions are welcome. TIA, Michael.

    Read the article

  • Spring URL mapping question

    - by es11
    I am using Java with Spring framework. Given the following url: www.mydomain.com/contentitem/234 I need to map all requests that come to /contentitem/{numeric value} mapped to a given controller with the "numeric value" passed as a parameter to the controller. Right now in my servlet container xml I have simple mappings similar to the following: ... <entry key="/index.html"> <ref bean="homeController" /> </entry> ... I am just wondering what I need to add to the mapping in order to achieve what I described? Edit: I unaccepted the answer temporarily because I can't seem to figure out how to do the mapping in my web.xml (I am using annotations as described in axtavt's answer below). How do I add a proper <url-pattern>..</url-pattern> in my <servlet-mapping> so that the request for "/contentitem/{numeric_value}" gets properly picked up? Thanks!

    Read the article

  • How to manually set an authenticated user in Spring Security / SpringMVC

    - by David Parks
    After a new user submits a 'New account' form, I want to manually log that user in so they don't have to login on the subsequent page. The normal form login page going through the spring security interceptor works just fine. In the new-account-form controller I am creating a UsernamePasswordAuthenticationToken and setting it in the SecurityContext manually: SecurityContextHolder.getContext().setAuthentication(authentication); On that same page I later check that the user is logged in with: SecurityContextHolder.getContext().getAuthentication().getAuthorities(); This returns the authorities I set earlier in the authentication. All is well. But when this same code is called on the very next page I load, the authentication token is just UserAnonymous. I'm not clear why it did not keep the authentication I set on the previous request. Any thoughts? Could it have to do with session ID's not being set up correctly? Is there something that is possibly overwriting my authentication somehow? Perhaps I just need another step to save the authentication? Or is there something I need to do to declare the authentication across the whole session rather than a single request somehow? Just looking for some thoughts that might help me see what's happening here.

    Read the article

  • upgrading to spring 3.0 problem with interceptorNames

    - by mkoryak
    I am trying to upgrade to Spring 3.0 and i have the following issues: Finding the dependencies. People recommend using maven, but id rather not try to learn how to use maven/install it if the jars are available somewhere for download. The following bean declaration is now longer valid but i dont know how to fix it: <bean id="service" class="org.springframework.aop.framework.ProxyFactoryBean"> <property name="proxyInterfaces" value="com.service.SomeService" /> <property name="target"> <bean class="com.service.SomeServiceImpl"> </bean> </property> <property name="interceptorNames"> <list> <value>hibernateInterceptor</value> </list> </property> </bean> The complaint is that <property name="interceptorNames"> is no longer supported and should be done some other way

    Read the article

  • Spring 3 MVC validation BindingResult doesn't contain any errors

    - by Travelsized
    I'm attempting to get a Spring 3.0.2 WebMVC project running with the new annotated validation support. I have a Hibernate entity annotated like this: @Entity @Table(name = "client") public class Client implements Serializable { private static final long serialVersionUID = 1L; @Id @Basic(optional = false) @Column(name = "clientId", nullable = false) @NotEmpty private Integer clientId; @Basic(optional = false) @Column(name = "firstname", nullable = false, length = 45) @NotEmpty @Size(min=2, max=45) private String firstname; ... more fields, getters and setters } I've turned on mvc annotation support in my applicationContext.xml file: <mvc:annotation-driven /> And I have a method in my controller that responds to a form submission: @RequestMapping(value="/addClient.htm") public String addClient(@ModelAttribute("client") @Valid Client client, BindingResult result) { if(result.hasErrors()) { return "addClient"; } service.storeClient(client); return "clientResult"; } When my app loads in the server, I can see in the server log file that it loads a validator: 15 [http-8084-2] INFO org.hibernate.validator.util.Version - Hibernate Validator 4.0.2.GA The problem I'm having is that the validator doesn't seem to kick in. I turned on the debugger, and when I get into the controller method, the BindingResult contains 0 errors after I submit an empty form. (The BindingResult does show that it contains the Client object as a target.) It then proceeds to insert a record without an Id and throws an exception. If I fill out an Id but leave the name blank, it creates a record with the Id and empty fields. What steps am I missing to get the validation working?

    Read the article

  • How to collect and inject all beans of a given type in Spring XML configuration

    - by GrzegorzOledzki
    One of the strongest accents of the Spring framework is the Dependency Injection concept. I understand one of the advices behind that is to separate general high-level mechanism from low-level details (as announced by Dependency Inversion Principle). Technically, that boils down to having a bean implementation to know as little as possible about a bean being injected as a dependency, e.g. public class PrintOutBean { private LogicBean logicBean; public void action() { System.out.println(logicBean.humanReadableDetails()); } //... } <bean class="PrintOutBean"> <property name="loginBean" ref="ShoppingCartBean"/> </bean> But what if I wanted to a have a high-level mechanism operating on multiple dependent beans? public class MenuManagementBean { private Collection<Option> options; public void printOut() { for (Option option:options) { // do something for option } //... } } I know one solution would be to use @Autowired annotation in the singleton bean, that is... @Autowired private Collection<Option> options; But doesn't it violate the separation principle? Why do I have to specify what dependents to take in the very same place I use them (i.e. MenuManagementBean class in my example)? Is there a way to inject collections of beans in the XML configuration like this (without any annotation in the MMB class)? <bean class="MenuManagementBean"> <property name="options"> <xxx:autowire by-type="MyOptionImpl"/> </property> </bean>

    Read the article

  • Why doesn't the spring @Autowire work with java generics

    - by testing123
    Inspired by spring data awesomeness I wanted to create a abstract RESTController that I could extend for a lot of my controllers. I created the following class: @Controller public abstract class RESTController<E, PK extends Serializable, R extends PagingAndSortingRepository<E, PK>> { @Autowired private R repository; @RequestMapping(method=RequestMethod.GET, params={"id"}) @ResponseBody public E getEntity(@RequestParam PK id) { return repository.findOne(id); } ... } I was hoping that the generics would allow me to @Autowire in the repository but I get the following error: SEVERE: Allocate exception for servlet appServlet org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.springframework.data.repository.PagingAndSortingRepository] is defined: expected single matching bean but found 3: [groupRepository, externalCourseRepository, managedCourseRepository] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:800) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) I understand what the error is telling me, there is more than one match for the @Autowire. I am confused because I thought by creating the following controller it would work: @Controller @RequestMapping(value="/managedCourse") public class ManagedCourseController extends RESTController<ManagedCourse, Long, ManagedCourseRepository> { ... } This is easy enough to work around by doing having a method like this in the RESTController: protected abstract R getRepository(); and then doing this in your implementing class: @Autowired private ManagedCourseRepository repository; @Override protected ManagedCourseRepository getRepository() { return repository; } I was just wondering if someone had any thoughts of how I could get this to work.

    Read the article

  • Strange behavior while returning csv file from spring controller

    - by Fanooos
    I working in a spring application which have an action method that returns a CSV file. This action works fine but in some cases it throws a predefined exception (MyAppException). I have another method that is annotated @ExceptionHandler(MyAppException.class) In the exception handler method I return another csv file but with different contents. The code that returns the csv file is almost the same in the two methods. List<String[]> list= new ArrayList<String[]>(); list.add(new String[]{ integrationRequestErrorLog.getErrorMessage(), Long.toString(integrationRequestErrorLog.getId()), Integer.toString(integrationRequestErrorLog.getErrorCode()) }); CSVWriter writer = new CSVWriter(response.getWriter(), ','); writer.writeAll(list); writer.close(); the difference between the two method is the list of contents. In the first method the file is returned normally while in the exception handler method I have a strange behavior. The exception handler method works fine with Opera browser while it gives me a 404 with FireFox. Opera browser give me 404 also but it download the file while firefox does not? Really I do not understand what is the difference here.

    Read the article

  • Why does deploying a .NET Compact Framework assembly cause .NET Desktop Framework assemblies to be d

    - by Matthew Belk
    I am trying to get one of my developers set up to work on a fairly large .NETCF project. When we try to simply deploy the solution and all of its projects to a target device, deploying one of the projects triggers several assemblies from the desktop framework to be copied from the GAC to the device. What on earth could cause this? The assemblies from the "big" framework are ones like System.DirectoryServices, System.Design, and a bunch of others.

    Read the article

  • Spring + JSR 303 Validation group is ignored [closed]

    - by nsideras
    we have a simple bean with JSR annotations public class CustomerDTO { private static final long serialVersionUID = 1L; private Integer id; @NotEmpty(message = "{customer.firstname.empty}") private String firstName; @NotEmpty(message = "{customer.lastname.empty}") private String lastName; @NotEmpty(groups={PasswordChange.class}, message="{password.empty}") private String password; @NotEmpty(groups={PasswordChange.class}, message="{confirmation.password.empty}") private String password2; } and we have a Spring Controller @RequestMapping(value="/changePassword", method = RequestMethod.POST) public String changePassword(@Validated({ PasswordChange.class }) @ModelAttribute("customerdto") CustomerDTO customerDTO, BindingResult result, Locale locale) { logger.debug("Change Password was submitted with information: " + customerDTO.toString()); try { passwordStrengthPolicy.checkPasswordStrength(locale, customerDTO.getPassword()); if (result.hasErrors()) { return "changePassword"; } logger.debug("Calling customer service changePassword: " + customerDTO); customerOnlineNewService.changePassword(customerDTO); } catch (PasswordNotChangedException e) { logger.error("Could not change password PasswordNotChangedException: " + customerDTO.toString()); return "changePassword"; } catch (PasswordNotSecureException e) { return "changePassword"; } return createRedirectViewPath("changePassword"); } Our problem is that when changePassword is invoked the validator ignores the group(PasswordChange.class) and validates only firstName and lastName which are not in the group. Any idea? Thank you very much for your time.

    Read the article

  • Spring Security - Interactive login attempt was unsuccessful

    - by Taylor L
    I've been trying to track down why Spring Security isn't creating the SPRING_SECURITY_REMEMBER_ME_COOKIE so I turned on logging for org.springframework.security.web.authentication.rememberme. At first glance, the logs make it seem like the login is failing but the login is actually successful in the sense that if I navigate to a page that requires authentication I am not redirected back to the login page. However, the logs appear to be saying the login credentials are invalid. Any ideas as to what is going on? Mar 16, 2010 10:05:56 AM org.springframework.security.web.authentication.rememberme.PersistentTokenBasedRememberMeServices onLoginSuccess FINE: Creating new persistent login for user [email protected] Mar 16, 2010 10:10:07 AM org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices loginFail FINE: Interactive login attempt was unsuccessful. Mar 16, 2010 10:10:07 AM org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices cancelCookie FINE: Cancelling cookie <http auto-config="false"> <intercept-url pattern="/css/**" filters="none" /> <intercept-url pattern="/img/**" filters="none" /> <intercept-url pattern="/js/**" filters="none" /> <intercept-url pattern="/app/admin/**" filters="none" /> <intercept-url pattern="/app/login/**" filters="none" /> <intercept-url pattern="/app/register/**" filters="none" /> <intercept-url pattern="/app/error/**" filters="none" /> <intercept-url pattern="/" filters="none" /> <intercept-url pattern="/**" access="ROLE_USER" /> <logout logout-success-url="/" /> <form-login login-page="/app/login" default-target-url="/" authentication-failure-url="/app/login?login_error=1" /> <session-management invalid-session-url="/app/login" /> <remember-me services-ref="rememberMeServices" key="myKey" /> </http> <authentication-manager alias="authenticationManager"> <authentication-provider user-service-ref="userDetailsService"> <password-encoder hash="sha-256" base64="true"> <salt-source user-property="username" /> </password-encoder> </authentication-provider> </authentication-manager> <beans:bean id="userDetailsService" class="com.my.service.auth.UserDetailsServiceImpl" /> <beans:bean id="rememberMeServices" class="org.springframework.security.web.authentication.rememberme.PersistentTokenBasedRememberMeServices"> <beans:property name="userDetailsService" ref="userDetailsService" /> <beans:property name="tokenRepository" ref="persistentTokenRepository" /> <beans:property name="key" value="myKey" /> </beans:bean> <beans:bean id="persistentTokenRepository" class="com.my.service.auth.PersistentTokenRepositoryImpl" />

    Read the article

  • Vote of Disconfidence to Entity Framework

    - by Ricardo Peres
    A friend of mine has found the following problem with Entity Framework 4: Two simple classes and one association between them (one to many): One condition to filter out soft-deleted entities (WHERE Deleted = 0): 100 records in the database; A simple query: 1: var l = ctx.Person.Include("Address").Where(x => (x.Address.Name == "317 Oak Blvd." && x.Address.Number == 926) || (x.Address.Name == "891 White Milton Drive" && x.Address.Number == 497)); Will produce the following SQL: 1: SELECT 2: [Extent1].[Id] AS [Id], 3: [Extent1].[FullName] AS [FullName], 4: [Extent1].[AddressId] AS [AddressId], 5: [Extent202].[Id] AS [Id1], 6: [Extent202].[Name] AS [Name], 7: [Extent202].[Number] AS [Number] 8: FROM [dbo].[Person] AS [Extent1] 9: LEFT OUTER JOIN [dbo].[Address] AS [Extent2] ON ([Extent2].[Deleted] = 0) AND ([Extent1].[AddressId] = [Extent2].[Id]) 10: LEFT OUTER JOIN [dbo].[Address] AS [Extent3] ON ([Extent3].[Deleted] = 0) AND ([Extent1].[AddressId] = [Extent3].[Id]) 11: LEFT OUTER JOIN [dbo].[Address] AS [Extent4] ON ([Extent4].[Deleted] = 0) AND ([Extent1].[AddressId] = [Extent4].[Id]) 12: LEFT OUTER JOIN [dbo].[Address] AS [Extent5] ON ([Extent5].[Deleted] = 0) AND ([Extent1].[AddressId] = [Extent5].[Id]) 13: LEFT OUTER JOIN [dbo].[Address] AS [Extent6] ON ([Extent6].[Deleted] = 0) AND ([Extent1].[AddressId] = [Extent6].[Id]) 14: ... 15: WHERE ((N'317 Oak Blvd.' = [Extent2].[Name]) AND (926 = [Extent3].[Number])) 16: ... And will result in 680 MB of memory being taken! Now, Entity Framework has been historically known for producing less than optimal SQL, but 680 MB for 100 entities?! According to Microsoft, the problem will be addressed in the following version, there is a Connect issue open. There is even a whitepaper, Performance Considerations for Entity Framework 5, which talks about some of the changes and optimizations coming on version 5, but by reading it, I got even more concerned: “Once the cache contains a set number of entries (800), we start a timer that periodically (once-per-minute) sweeps the cache.” Say what?! The next version of Entity Framework will spawn timer threads?! When Code First came along, I thought it was a step in the right direction. Sure, it didn’t include some things that NHibernate did for quite some time – for example, different strategies for Id generation that do not rely on IDENTITY columns, which makes INSERT batching impossible, or support for enumerated types – but I thought these would come with the time. Now, enumerated types have, but so did… timer threads! I’m afraid Entity Framework is becoming a monster.

    Read the article

  • Spring boot JAR as windows service

    - by roblovelock
    I am trying to wrap a spring boot "uber JAR" with procrun. Running the following works as expected: java -jar my.jar I need my spring boot jar to automatically start on windows boot. The nicest solution for this would be to run the jar as a service (same as a standalone tomcat). When I try to run this I am getting "Commons Daemon procrun failed with exit value: 3" Looking at the spring-boot source it looks as if it uses a custom classloader: https://github.com/spring-projects/spring-boot/blob/master/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/JarLauncher.java I also get a "ClassNotFoundException" when trying to run my main method directly. java -cp my.jar my.MainClass Is there a method I can use to run my main method in a spring boot jar (not via JarLauncher)? Has anyone successfully integrated spring-boot with procrun? I am aware of http://wrapper.tanukisoftware.com/. However due to their licence I can't use it. UPDATE I have now managed to start the service using procrun. set SERVICE_NAME=MyService set BASE_DIR=C:\MyService\Path set PR_INSTALL=%BASE_DIR%prunsrv.exe REM Service log configuration set PR_LOGPREFIX=%SERVICE_NAME% set PR_LOGPATH=%BASE_DIR% set PR_STDOUTPUT=%BASE_DIR%stdout.txt set PR_STDERROR=%BASE_DIR%stderr.txt set PR_LOGLEVEL=Error REM Path to java installation set PR_JVM=auto set PR_CLASSPATH=%BASE_DIR%%SERVICE_NAME%.jar REM Startup configuration set PR_STARTUP=auto set PR_STARTIMAGE=c:\Program Files\Java\jre7\bin\java.exe set PR_STARTMODE=exe set PR_STARTPARAMS=-jar#%PR_CLASSPATH% REM Shutdown configuration set PR_STOPMODE=java set PR_STOPCLASS=TODO set PR_STOPMETHOD=stop REM JVM configuration set PR_JVMMS=64 set PR_JVMMX=256 REM Install service %PR_INSTALL% //IS//%SERVICE_NAME% I now just need to workout how to stop the service. I am thinking of doing someting with the spring-boot actuator shutdown JMX Bean. What happens when I stop the service at the moment is; windows fails to stop the service (but marks it as stopped), the service is still running (I can browse to localhost), There is no mention of the process in task manager (Not very good! unless I am being blind).

    Read the article

  • Spring.NET & Immediacy CMS (or how to inject to server side controls without using PageHandlerFactor

    - by Simon Rice
    Is there any way to inject dependencies into an Immediacy CMS control using Spring.NET, ideally without having to use to ContextRegistry when initialising the control? Update, with my own answer The issue here is that Immediacy already has a handler defined in web.config that deals with all aspx pages, & so it's not possible add an entry for Spring.NET's PageHandlerFactory in web.config as per a normal webforms app. That rules out making the control implement ISupportsWebDependencyInjection. Furthermore, most of Immediacy's generated pages are aspx pages that don't physically exist on the drive. I have changed the title of the question to reflect this. What I have done to get Dependency Injection working is: Add the usual entries to web.config for Spring.NET as outlined in the documentation, except for the adding the entry to the <httpHandlers> section. In this case I've got my object definitions in Spring.config. Create the following abstract base class that will deal with all of the Dependency Injection work: DIControl.cs public abstract class DIControl : ImmediacyControl { protected virtual string DIName { get { return this.GetType().Name; } } protected override void OnInit(EventArgs e) { if (ContextRegistry.GetContext().GetObject(DIName, this.GetType()) != null) ContextRegistry.GetContext().ConfigureObject(this, DIName); base.OnInit(e); } } For non-immediacy controls, you can make this server side control inherit from Control or whatever subclass of that you like. For any control with which you wish to use with Spring.NET's Inversion of Control container, define it to inherit from DIControl & add the relelvant entry to Spring.config, for example: SampleControl.cs public class SampleControl : DIControl, INamingContainer { public string Text { get; set; } protected string InjectedText { get; set; } public SampleControl() : base() { Text = "Hello world"; } protected override void RenderContents(HtmlTextWriter output) { output.Write(string.Format("{0} {1}", Text, InjectedText)); } } Spring.config <objects xmlns="http://www.springframework.net"> <object id="SampleControl" type="MyProject.SampleControl, MyAssembly"> <property name="InjectedText" value="from Spring.NET" /> </object> </objects> You can optionally override DIName if you wish to name your entry in Spring.config differently from the name of your class. Provided everything's done correctly, you will have the control writing out "Hello world from Spring.NET!" when used in a page. This solution uses Spring.NET's ContextRegistry from within the control, but I would be surprised if there's no way around that for Immediacy at least since the page objects themselves aren't accessible. However, can this be improved at all from a Spring.NET perspective? Is there maybe an Immediacy plugin that already does this that I'm completely unaware of? Or is there an approach that does this in a more elegant way? I'm open to suggestions.

    Read the article

  • @Secured not working

    - by user3640507
    I am new to spring and trying to implement Role based authorization with the help of @Secured annotation. I have a method which is specifically for ADMIN and I have written @Secured ("ROLE_ADMIN") to secure it. @Secured ("ROLE_ADMIN") public void HelloUser(String name) { System.out.println("Hello ADMIN"); } Now when I call this method by creating a class object it gets called eventhough user dont have ADMIN authority But when I dont create an object and use @autowired annotation instead then it works i.e User is not allowed to access this method. In my security.xml as well as servlet.xml I have added <global-method-security secured-annotations="enabled" /> Can some one please tell me where I am going wrong or is this the natural behaviour in spring ?

    Read the article

  • Data binding in an ASP.Net application with Entity Framework

    - by nikolaosk
    This is going to be the eighth post of a series of posts regarding ASP.Net and the Entity Framework and how we can use Entity Framework to access our datastore. You can find the first one here , the second one here , the third one here , the fourth one here , the fifth one here ,the sixth one here and the seventh one here . I have a post regarding ASP.Net and EntityDataSource . You can read it here .I have 3 more posts on Profiling Entity Framework applications. You can have a look at them here ...(read more)

    Read the article

  • Using stored procedures with Entity Framework in an ASP.Net application

    - by nikolaosk
    This is going to be the third post of a series of posts regarding ASP.Net and the Entity Framework and how we can use Entity Framework to access our datastore. You can find the first one here and the second one here . I have a post regarding ASP.Net and EntityDataSource. You can read it here .I have 3 more posts on Profiling Entity Framework applications. You can have a look at them here , here and here . In this post I will show you how to select,insert,update,delete data in the database using EF...(read more)

    Read the article

  • Entity Framework and Plain Old CLR Objects in an ASP.Net application

    - by nikolaosk
    This is going to be the sixth post of a series of posts regarding ASP.Net and the Entity Framework and how we can use Entity Framework to access our datastore. You can find the first one here , the second one here and the third one here , the fourth one here and the fifth one here . I have a post regarding ASP.Net and EntityDataSource. You can read it here .I have 3 more posts on Profiling Entity Framework applications. You can have a look at them here , here and here . In this post I will be looking...(read more)

    Read the article

  • Lazy Loading,Eager Loading,Explicit Loading in Entity Framework 4

    - by nikolaosk
    This is going to be the ninth post of a series of posts regarding ASP.Net and the Entity Framework and how we can use Entity Framework to access our datastore. You can find the first one here , the second one here , the third one here , the fourth one here , the fifth one here ,the sixth one here ,the seventh one here and the eighth one here . I have a post regarding ASP.Net and EntityDataSource . You can read it here .I have 3 more posts on Profiling Entity Framework applications. You can have a...(read more)

    Read the article

  • How to handle concurrency in Entity Framework

    - by nikolaosk
    This is going to be the fifth post of a series of posts regarding ASP.Net and the Entity Framework and how we can use Entity Framework to access our datastore. You can find the first one here , the second one here and the third one here . You can read the fourth one here . I have a post regarding ASP.Net and EntityDataSource. You can read it here .I have 3 more posts on Profiling Entity Framework applications. You can have a look at them here , here and here . In this post I will be looking into...(read more)

    Read the article

  • Identity Map Pattern and the Entity Framework

    - by nikolaosk
    This is going to be the seventh post of a series of posts regarding ASP.Net and the Entity Framework and how we can use Entity Framework to access our datastore. You can find the first one here , the second one here and the third one here , the fourth one here , the fifth one here and the sixth one here . I have a post regarding ASP.Net and EntityDataSource. You can read it here .I have 3 more posts on Profiling Entity Framework applications. You can have a look at them here , here and here . In...(read more)

    Read the article

  • Android/Java AI agent framework/middleware

    - by corneliu
    I am looking for an AI agent framework to use as a starting point in an Android game I have to create for a university research project. It has been suggested to me to use JADE, but, as far as I can tell, it's not a suitable framework for games (at least for my game idea) because it runs in a split-execution mode, and it needs an always-active network connection to a main host. What I want is just a little something to give me a headstart. I am willing to adjust the game's features to the framework because it's more of a mockup game, and the purpose is to compare the performance of a couple of agents in the game world. The game will be very simplistic, with a minimal UI that displays various stats about the characters in the game (so no graphics, no pathfinding). Thank you.

    Read the article

  • Play audio file data - Spring MVC

    - by Vijay Veeraraghavan
    In my web-application, I have various audio clips uploaded by the users in the database stored in the BLOB column. The audio files are low bit rate WAV files. The clips are secured, one can see only those clips he has uploaded. Instead of user downloading the clip and playing it in his player, I need it be steamed online in the web page itself. In the jsp I use the <audio> tag with the source mapping to the controller mappping url. <td> <audio controls><source src="recfile/${au.id}" type="audio/mpeg" /></audio> </td> Where, the recfile is the request mapping and the au.id is the audio id. In the controller I process the request like below @RequestMapping(value = "/recfile/{id}", method = RequestMethod.GET, produces = { MediaType.APPLICATION_OCTET_STREAM_VALUE }) public HttpEntity<byte[]> downloadRecipientFile(@PathVariable("id") int id, ModelMap model, HttpServletResponse response) throws IOException, ServletException { LOGGER.debug("[GroupListController downloadRecipientFile]"); VoiceAudioLibrary dGroup = audioClipService.findAudioClip(id); if (dGroup == null || dGroup.getAudioData() == null || dGroup.getAudioData().length <= 0) { throw new ServletException("No clip found/clip has not data, id=" + id); } HttpHeaders header = new HttpHeaders(); I tried this too //header.setContentType(new MediaType("audio", "mp3")); header.setContentType(new MediaType("audio", "vnd.wave"); header.setContentLength(dGroup.getAudioData().length); return new HttpEntity<byte[]>(dGroup.getAudioData(), header); } When the jsp loads, the controller get the request, it serves back the audio data fetched from the database, the jsp too shows the player with the controls. But when I play it nothing happens. Why is it? Am I missing anything in the configuration? Am I doing it right?

    Read the article

  • Spring 3.0 making JSON response using jackson message converter

    - by dupdup
    i configure my messageconverter as Jackson's then class Foo{int x; int y} and in controller @ResponseBody public Foo method(){ return new Foo(3,4) } from that i m expecting to return a JSON string {x:'3',y:'4'} from server without any other configuration. but getting 404 error response to my ajax request If the method is annotated with @ResponseBody, the return type is written to the response HTTP body. The return value will be converted to the declared method argument type using HttpMessageConverters. Am I wrong ? or should I convert my response Object to Json string myself using serializer and then returning that string as response.(I could make string responses correctly) or should I make some other configurations ? like adding annotations for class Foo here is my conf.xml <bean id="jacksonMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> <property name="messageConverters"> <list> <ref bean="jacksonMessageConverter"/> </list> </property>

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >