Search Results

Search found 4902 results on 197 pages for 'spring batch'.

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

  • Build a user's profile directory on creation in batch

    - by Moses
    I have a batch script that I use when I set up new Windows 7 PCs that creates a user based on a variable, creates a folder on their desktop, then shares it: @echo off SET /p unitnumber="Enter unit number: " net user unit%unitnumber% password /add /expire:never MD "C:/Users/unit%unitnumber%/Desktop/Accounting #%unitnumber%" runas /user:administrator "net share "Accounting#%unitnumber%"="C:/Users/unit%unitnumber%/Desktop/Accounting#%unitnumber"" I discovered that the share that is created is overwritten when the newly created user first logs on, because Windows creates builds their profile directory at that time. Is there any way to initiate a build of a user's profile directory in the batch file just after creating the it? The only thing that looks useful is the /homedir:pathname switch for the net user command, but I believe that option assumes the directory already exists. Other than that web research hasn't been fruitful. I'd be to use whatever to get this done as long as I can incorporate/launch it from the batch. Any suggestions?

    Read the article

  • Batch Convert .mkv to .mp4 with VLC

    - by IamHere
    i want to batch convert all .mkv file in a folder into .mp4 with vlc. it should use the original video-/audio-stream and if possible the .ass subtitle of the .mkv. so its not really a convert, its more changing the container. (my player cant read the mkv) if i do this conversion by hand (manually) it works, but i have a lot of mkv to convert, so it would take a lot of time. i have searched the internet for a batch file to do this and i found a few and tried to modify them to my wish, but all attempts i tried just created a .mp4 file that doesn't contain the audio-stream and the video-stream also cannot be rendered by all my mediaplayers on the pc. so i would be very thankful, if you could tell me how the batch have to look like, so it works with original video-/audio-stream (maybe .ass subtitle)

    Read the article

  • Why doesn't this batch file work for me?

    - by asdfg
    The following batch file is not woking. @echo off python -c "print('echo text')" %TEMP%\test.bat call %TEMP%\test.bat Can anyone help me with this?. edit: I needed unix eval functionality in windows. I could not find a direct way though. So I redirected the eval string to a temporary batch file and executed it. The temporary batch file was successfully created but calling it did not work in the above case. I noticed that any command after the test.bat creation did not work.

    Read the article

  • Windows batch file reference to own directory

    - by rwallace
    Suppose you have C:\foo\foo.bat which needs to refer to C:\foo\foo.txt. It may be run from a different directory, but needs to get foo.txt from its own directory, not the current directory. Obviously this could be done by putting the full path C:\foo\foo.txt in foo.bat. The twist is, it's not known at the time of writing the batch file, where it will end up residing on the user's machine, so what the batch file actually needs to do is get foo.txt from the directory where I live, wherever that happens to be. (In a C program I'd use argv[0] but that doesn't seem to work with batch files.) Is there a way to do this?

    Read the article

  • When not to use Spring to instantiate a bean?

    - by Rishabh
    I am trying to understand what would be the correct usage of Spring. Not syntactically, but in term of its purpose. If one is using Spring, then should Spring code replace all bean instantiation code? When to use or when not to use Spring, to instantiate a bean? May be the following code sample will help in you understanding my dilemma: List<ClassA> caList = new ArrayList<ClassA>(); for (String name : nameList) { ClassA ca = new ClassA(); ca.setName(name); caList.add(ca); } If I configure Spring it becomes something like: List<ClassA> caList = new ArrayList<ClassA>(); for (String name : nameList) { ClassA ca = (ClassA)SomeContext.getBean(BeanLookupConstants.CLASS_A); ca.setName(name); caList.add(ca); } I personally think using Spring here is an unnecessary overhead, because The code the simpler to read/understand. It isn't really a good place for Dependency Injection as I am not expecting that there will be multiple/varied implementation of ClassA, that I would like freedom to replace using Spring configuration at a later point in time. Am I thinking correct? If not, where am I going wrong?

    Read the article

  • Spring AOP Pointcut syntax for AND, OR and NOT

    - by ixlepixle
    I'm having trouble with a pointcut definition in Spring (version 2.5.6). I'm trying to intercept all method calls to a class, except for a given method (someMethod in the example below). <aop:config> <aop:advisor pointcut="execution(* x.y.z.ClassName.*(..)) AND NOT execution(* x.y.x.ClassName.someMethod(..))" /> </aop:config> However, the interceptor is invoked for someMethod as well. Then I tried this: <aop:config> <aop:advisor pointcut="execution(* x.y.z.ClassName.(* AND NOT someMethod)(..)) )" /> </aop:config> But this does not compile as it is not valid syntax (I get a BeanCreationException). Can anybody give any tips?

    Read the article

  • How to use role-hierarchy in Spring Security 3 with Spring EL?

    - by Aleksey
    I want to use @PreAuthorize annotation on service methods with Spring Security. One of requirements is to use role-hierarchy. But by default it is not enabled. I found that in SecurityExpressionRoot class ("the base class for expression root objects") there is a property roleHierarchy. The class actually does use this property for methods like hasRole() and hasAnyRole(). I suppose that if I supply it with my own RoleHierarchy bean I will be able to use @PreAuthorize annotations with hierarchical roles. How can I inject my hierarchy bean into SecurityExpressionRoot?

    Read the article

  • Spring AOP: how to get the annotations of the adviced method

    - by hubertg
    I'd like to implement declarative security with Spring/AOP and annotations. As you see in the next code sample I have the Restricted Annotations with the paramter "allowedRoles" for defining who is allowed to execute an adviced method. @Restricted(allowedRoles="jira-administrators") public void setPassword(...) throws UserMgmtException { // set password code ... } Now, the problem is that in my Advice I have no access to the defined Annotations: public Object checkPermission(ProceedingJoinPoint pjp) throws Throwable { Signature signature = pjp.getSignature(); System.out.println("Allowed:" + rolesAllowedForJoinPoint(pjp)); ... } private Restricted rolesAllowedForJoinPoint(ProceedingJoinPoint thisJoinPoint) { MethodSignature methodSignature = (MethodSignature) thisJoinPoint.getSignature(); Method targetMethod = methodSignature.getMethod(); return targetMethod.getAnnotation(Restricted.class); } The method above always returns null (there are no annotations found at all). Is there a simple solution to this? I read something about using the AspectJ agent but I would prefer not to use this agent.

    Read the article

  • Jersey, Spring, Tomcat and Security Annotations

    - by jr
    I need to secure a simple jersey RESTful API in a Tomcat 6.0.24 container. I'd like to keep the authentication with Basic Authentication using the tomcat-users.xml file to define the users and roles (this is for now, like I said its small). Now, for authorization I'd like to be able to use the JSR 250 annotations like @RolesAllowed, @PermitAll, @DenyAll, etc. I cannot for the life of me figure out how to wire this all up together. I really don't want to go spring-security route, since I need something very simple at the current time. Can someone point me in the right direction.

    Read the article

  • Spring Security Issue: Controller, Anonymous Requests...

    - by Srirangan
    Hey guys, I have an app that uses Spring security and BlazeDS. Flex 3.2 is used for the client app. Generally client app makes service calls using RemoteObjects. However, for certain cases client app is sending a request to a URL. We're using Annotated Controllers for URL mapping. Here's where the "Access is denied" exception comes up: 2010-04-12 11:43:23,486 [qtp5138683-16] ERROR fr.plasticomnium.gpoc.utils.ServiceExceptionInterceptor - Unexpected RuntimeException : Access is denied org.springframework.security.access.AccessDeniedException: Access is denied at org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:71) at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:203) at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at fr.plasticomnium.gpoc.utils.ServiceExceptionInterceptor.invoke(ServiceExceptionInterceptor.java:15) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) ... ...

    Read the article

  • Spring security access with multiple roles

    - by Evgeny Makarov
    I want to define access for some pages for user who has one of following roles (ROLE1 or ROLE2) I'm trying to configure this in my spring security xml file as following: <security:http entry-point-ref="restAuthenticationEntryPoint" access-decision-manager-ref="accessDecisionManager" xmlns="http://www.springframework.org/schema/security" use-expressions="true"> <!-- skipped configuration --> <security:intercept-url pattern="/rest/api/myUrl*" access="hasRole('ROLE1') or hasRole('ROLE2')" /> <!-- skipped configuration --> </security:http> I've tried various ways like: access="hasRole('ROLE1, ROLE2')" access="hasRole('ROLE1', 'ROLE2')" access="hasAnyRole('[ROLE1', 'ROLE2]')" etc but nothing seems to be working. I'm keep getting exception java.lang.IllegalArgumentException: Unsupported configuration attributes: or java.lang.IllegalArgumentException: Failed to parse expression 'hasAnyRole(['ROLE1', 'ROLE2'])' how should it be configured? Thanks

    Read the article

  • spring add default value to form:select

    - by Mike
    I'm developing a spring application, now I've added a dropdownlist to one of my jsp pages using: <form:select multiple="single" path="users[y.count-1].X" items="${Y}" itemValue="id" itemLabel="name"/> Now I'd like to add the default value "Nothing selected", however I can't seem to find how to do this. I've tried: <form:select multiple="single" path="users[y.count-1].X" items="${Y}" itemValue="id" itemLabel="name"> <form:option value="Nothing selected" /> </form:select> But "Nothing selected" isn't displayed in my dropdownlist.

    Read the article

  • Is it possible to inject a bean into a spring form bean

    - by Mike
    I tried to do it 2 different ways, but neither way worked. @Component public class EmailForm{ ... private QuestionDAO questionDAO; ... @Autowired public void setQuestionDAO(QuestionDAO questionDAO) { this.questionDAO = questionDAO; } ... Another way: @Component public class EmailForm implements ApplicationContextAware { ... public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.questionDAO = (QuestionDAO)applicationContext.getBean("questionDAO"); } ... Neither way results in questionDAO being injected Form bean is populated by spring: @RequestMapping(method = RequestMethod.POST) public String submit(@Valid final EmailForm emailForm, BindingResult result, final Model model) {

    Read the article

  • Bind multiple request parameters to one object in Spring 3

    - by Max
    Hi, I can't figure out a way to bind several arguments and headers to one request parameter using annotations in Spring 3. For example, let's say I'm getting this request: Headers: Content-type: text/plain; POST Body: Name: Max Now I want it all to mysteriously bind to this object: class NameInfo { String name; } Using some code like this: String getName() { if ("text/plain".equals(headers.get("content-type"))) { return body.get("name"); } else if ("xml".equals(headers.get("content-type")) { return parseXml(body).get("name"); } else ... } So that in the end I would be able to use: @RequestMapping(method = RequestMethod.POST) void processName(@RequestAttribute NameInfo name) { ... } Is there a way to achieve something similar to what I need? Thanks in advance.

    Read the article

  • Spring Data MongoDB Date between two Dates

    - by sics
    i'm using Spring Data for MongoDB and got the following classes class A { List<B> b; } class B { Date startDate; Date endDate; } when i save an object of A it gets persisted like { "_id" : "DQDVDE000VFP8E39", "b" : [ { "startDate" : ISODate("2009-10-05T22:00:00Z"), "endDate" : ISODate("2009-10-29T23:00:00Z") }, { "startDate" : ISODate("2009-11-01T23:00:00Z"), "endDate" : ISODate("2009-12-30T23:00:00Z") } ] } Now i want to query the db for documents matching entries in b where a given date is between startDate and endDate. Query query = new Query(Criteria.where("a").elemMatch( Criteria.where("startDate").gte(date) .and("endDate").lte(date) ); Which results in the following mongo query: { "margins": { "$elemMatch": { "startDate" : { "$gte" : { "$date" : "2009-11-03T23:00:00.000Z"}}, "endDate" : { "$lte" : { "$date" : "2009-11-03T23:00:00.000Z"}} } } } but returns no resulting documents. Does anybody know what i'm doing wrong? I don't get it... Thank you very much in advance!!

    Read the article

  • Spring - Redirect after POST (even with validation errors)

    - by Taylor L
    I'm trying to figure out how to "preserve" the BindingResult so it can be used in a subsequent GET via the Spring <form:errors> tag. The reason I want to do this is because of Google App Engine's SSL limitations. I have a form which is displayed via HTTP and the post is to an HTTPS URL. If I only forward rather than redirect then the user would see the https://whatever.appspot.com/my/form URL. I'm trying to avoid this. Any ideas how to approach this? Below is what I'd like to do, but I only see validation errors when I use return "create". @RequestMapping(value = "/submit", method = RequestMethod.POST) public final String submit( @ModelAttribute("register") @Valid final Register register, final BindingResult binding) { if (binding.hasErrors()) { return "redirect:/register/create"; } return "redirect:/register/success"; }

    Read the article

  • Why were annotations introduced in Spring and Hibernate?

    - by Chandrashekhar
    I would like to know why were annotations introduced in Spring and Hibernate? For earlier versions of both the frameworks book authors were saying that if we keep configuration in xml files then it will be easier to maintain (due to decoupling) and just by changing the xml file we can re-configure the application. If we use annotations in our project and in future we want to re-configure application then again we have to compile and build the project. So why were these annotations introduced in these frameworks? From my point of view annotations make the apps dependent on certain framework. Isn't it true?

    Read the article

  • Consuming Third Party web services through Spring WebServiceTemplate

    I'm trying to consume a Third Party web service, through a wsdl file provided. I would load the file locally from a Spring-J2EE based project underneath WEB-INF folder. The wsdl might have more than one operation exposed. So I need a way to be able to choose the method to be called. I would also need to make use of a JaxbMarshaller. Can anyone help with a code snippet for the same? Thanks for the help.

    Read the article

  • AddAllAttributes method spring mvc

    - by Nick Robertson
    I have two lists List<User> list_of_users=new ArrayList<User>(); List<String> list_of_attributes=new ArrayList<String>(); When i try to use the following lines of code: model.addAttribute("takeattributes",list_of_users); model.addAttribute("takeattributes",list_of_attributes); I realise that it keeps only the second list (list_of_attributes) and the first deleted. I was wondering how to keep both of these two lists in the model.Is this possible to be happened?Is the AddAllAttributes method what i need?If yes can anyone explain me how the AddAllAttributes method is working.I look at the spring mvc documentation but i didn't really understand.

    Read the article

  • Spring Roo and aspect-oriented programming

    - by marcos
    Hello, i've been running some experiments of my own with Spring Roo and it seems to be pretty cool, but i noticed that this tool makes heavy use of AOP on the model layer. I'm thinking about creating a real project using Roo and what i would like to know is: Why AOP is everywhere? Is That ok? What are advantages and disadvantages of this approach? I'm quite new to aspect-oriented programming and some guidance would be greatly appreciated. Thanks in advance!

    Read the article

  • spring json writes more json then i want

    - by mkoryak
    I am using the json spring view in order to return a simple JSON object from my controller. The problem is that its returning more data then i want. it is returning the validation errors and things inside of my model when all i am doing is this in the controller: Map model = new HashMap() model.put("success", "true"); return new ModelAndView("jsonView", model); If you look at the bottom of this page in the docs it looks like i am getting back data that POST would return. i am not doing a post, i am doing a GET by going directly to the URL with params. How do i get this lib to return just the data in my model?

    Read the article

  • Spring MVC JSP Parameters

    - by zpinter
    I'm looking to turn off try blocks for a specific JSP page (though turning it off globally would be OK as well). From what I've gathered, it looks something like this: <jsp-param> <param-name>noTryBlocks</param-name> <param-value>true</param-value> </jsp-param> However, everywhere I see that sample it's for a weblogic.xml file. Does anybody know how I can set this JSP parameters for a Spring MVC application? web.xml? Perhaps somewhere near here?: <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> <property name="prefix" value="/WEB-INF/jsp/"/> <property name="suffix" value=".jsp"/> </bean>

    Read the article

  • Spring data mapping problem.

    - by Yashwant Chavan
    Hi, I am using spring and hibernate along with my different components There is date field in DB as contract_end_date as a Date , so my pojo also contains date getter setter for contract_end_date, but when i submit form to Multiaction controller it gives data bindding exception for contract_end_date. It trying to search string getter setter for contract_end_date. So is there is any solution to handle this kind of problem. This is my pojo. after sumitting the form getting data binding exception public class Clnt implements java.io.Serializable { private String clntId; private String clntNm; private String busUnitNm; private String statCd; private String cmntTx; private Date contractEndDt; }

    Read the article

  • OpenId authentication and automatic registration with Spring Security 3.0.2

    - by xlluch
    I'm implementing an app using spring security 3.0.2 with OpenId login and registration. I can login succesfully, but if the user isn't registered i want to do: 1) Get some OpenId attributes like email and name. 2) Show to the user a registration form with just these two fields and the OpenId URI filled. I've been searching a lot but i didn't find an "ellegant" way of doing this. I wonder if some of u can come out with a solution to implement this strategy in my app. Thanks in advance.

    Read the article

  • Binding a select box to a Collection (with Spring)

    - by WiPU
    i have the following problem. I have a form bean and in this bean is a list with objects. List<SomeObjectForm> toDisplay; Now i want map a html select to this list. Something like that: <form:select id="inputGroupFields" path="templateKey" multiple="true"... <form:select id="inputGroupFields" path="templateKey.id" multiple="true"... And this dosnt work of course. Now i have tryed to add different custom Converter like: myConv implements Converter<SomeObjectForm, String> myConv extends StringToObject And this also not work. I'm not sure if this is the right approach or there is a easier way to do that. Some addional Infos: --i'm using spring 3.0.5 --all this happens during a web flow regards and thanks, WiPu

    Read the article

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