분류 전체보기(848)
-
Javascript split 함수에 정규식 적용하기
'콤마, 세미콜론, 파이프'로 나누기const text = "apple,banana;cherry|date";const result = text.split(/[,;|]/); // Split on commas, semicolons, or pipesconsole.log(result);// Output: ['apple', 'banana', 'cherry', 'date']'스페이스바'로 나누기const text = "Hello World How Are You";const result = text.split(/\s+/); // Split on one or more spacesconsole.log(result);// Output: ['Hello', 'World', 'How', 'Are', 'You']2개만 ..
2024.12.05 -
Spring boot 이미지 Map으로 전달하기
Spring boot@RestController@RequestMapping("/api")public class ResourceController { @GetMapping("/resource-with-map") public ResponseEntity> getResourceWithMap() throws IOException { // Load the resource (example: an image) Path imagePath = Paths.get("/path/to/your/image.jpg"); Resource resource = new UrlResource(imagePath.toUri()); if (!resource.exists() || !res..
2024.12.05 -
Spring boot URL로 access되지 않는 이미지 웹으로 전달하기
Spring bootimport org.springframework.core.io.Resource@RestController@RequestMapping("/images")public class ImageController { @GetMapping("/{imageName}") public ResponseEntity getImage(@PathVariable String imageName) throws IOException { Path imagePath = Paths.get("/path/to/your/private/images/" + imageName); Resource resource = new UrlResource(imagePath.toUri()); if (..
2024.12.05 -
Sencha panel에 html을 사용하여 이미지 나오게 하기
Ext.application({ name: 'ImageApp', launch: function () { Ext.create('Ext.container.Viewport', { layout: 'fit', items: [ { xtype: 'panel', title: 'Image Display', html: '' } ] }); }});
2024.12.05 -
Sencha treepanel row 선택하기
Row ID로 선택하기// Assuming your TreePanel is already created and has an id or referenceExt.onReady(function () { var treePanel = Ext.getCmp('myTreePanel'); // Replace 'myTreePanel' with your TreePanel's id // Get the selection model var selectionModel = treePanel.getSelectionModel(); // Find a node by id or some other identifier var node = treePanel.getStore().getNodeById('desiredNod..
2024.12.05 -
Javascript 시간 더하기
function addMinutesToCurrentTime(minutesToAdd) { const now = new Date(); // Get the current date and time now.setMinutes(now.getMinutes() + minutesToAdd); // Add 15 minutes return now;}// Example usageconst updatedTime = addMinutesToCurrentTime(15);console.log(updatedTime.toLocaleTimeString('en-US', { hour12: false })); // Example output: "15:30:00" (24-hour format)
2024.12.05